1

Some of my tests are taking long time, and I want to have an option to run only short tests or all tests. I have found option to disable some tests (Disable individual Python unit tests temporarily), but I didn't find option to, for example, set some flag in python -m unittest run those disabled tests anyway. What's the best practice here?

3
  • Thank you for your answer, but I am using unittest, not pytest. Commented Aug 31, 2020 at 12:12
  • Ah, sorry - as far as I know, there is no such flag in unittest. You could use skipifinstead and check for some environment variable, which you have to set if you want to run (or skip) the tests. Commented Aug 31, 2020 at 12:18
  • That seems to work, thank you very much! Commented Aug 31, 2020 at 12:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.