craigahobbs / unittest-parallel

Parallel unit test runner for Python with coverage support
MIT License
29 stars 5 forks source link

Feature -f / --failfast option #10

Closed mwchambers closed 3 years ago

mwchambers commented 3 years ago

Would it be possible to add an option which stops the test run on the first error or failure?

Like: https://docs.python.org/3/library/unittest.html#cmdoption-unittest-f

It looks like failfast=True could be passed to unittest.TextTestRunner

https://docs.python.org/3/library/unittest.html#unittest.TextTestRunner

Though I imagine there is other work that would need to be done to shutdown the multiprocessing.Pool so other tests do not continue to run?

craigahobbs commented 3 years ago

Yes, that should be straightforward to add. I'll take a look.

craigahobbs commented 3 years ago

Released unittest-parallel 1.4.0 with "--failfast" argument. Let me know if it doesn't work as expected.

mwchambers commented 3 years ago

@craigahobbs Thank you for spending your time on this, it is much appreciated!