Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

--exitfirst pytest CLI option is being ignored #60

Open
ethagnawl opened this issue Dec 11, 2019 · 0 comments
Open

--exitfirst pytest CLI option is being ignored #60

ethagnawl opened this issue Dec 11, 2019 · 0 comments

Comments

@ethagnawl
Copy link

Given the following pytest.ini configuration file:

[pytest]
addopts = --exitfirst --log-cli-level=debug --workers auto

I see the following when running my test suite containing an unhandled exception.

# ...
tests/unit/test_foo.py::test_foo /home/appuser/app
PASSED                                                                                  
tests/unit/test_bar.py::test_bar /home/appuser/app
FAILED
tests/unit/test_baz.py::test_baz /home/appuser/app
PASSED
# ...
1 failed, 114 passed, 2 skipped, 9 warnings in 122.04s (0:02:02)

I've only used Python's Process API in very trivial ways, so the following may be wildly off the mark: I took a brief look at how the parallelization provided by this library works and I think you could achieve the standard pytest behavior by running a loop while the processes are in progress, checking their exitcodes and terminating all of the others (and closing the queue?) if any one returns a failure exitcode.

Is this something you'd consider doing? If so, I could try to put a PR together.

Either way, this library has been a tremendous productivity booster and reduced the run time of my test suite from ~11 minutes to ~2 minutes. So, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant