Incorrect mixture of exit code and jUnit report when pytest.exit is called and a fixture teardown fails #8750
Labels
plugin: junitxml
related to the junitxml builtin plugin
topic: fixtures
anything involving fixtures directly or indirectly
type: bug
problem that needs to be addressed
Consider the following file:
Run this with
pytest --junit-xml=junit.xml
. The exit code is 1, which, per the documentation, means “some of the tests failed”. However, if you examinejunit.xml
, it does not record any failed tests! I’m not sure whether the exit code ought to be 2 (because of thepytest.exit
call) or whether the test teardown ought to be recorded as a failure injunit.xml
(because of the assertion failure, and the exit code remain 1 in this case), and I don’t really care that much which one happens, but it ought to be one or the other.This happened on Pytest 6.2.4 under Linux.
The text was updated successfully, but these errors were encountered: