Skipping teardown with KeyboardInterrupt #4517
Labels
topic: fixtures
anything involving fixtures directly or indirectly
type: bug
problem that needs to be addressed
I think there's bug regarding running pytest_runtest_teardown in the presence of a KeyboardInterrupt:
Expected (no KeyboardInterrupt):
Observed (with KeyboardInterrupt):
Note the missing 'runtest_teardown, pre teardown' and 'runtest_teardown, post teardown' in the observed output.
Second, there seems to be bug regarding running multiple finalizers in the presence of a KeyboardInterrupt AND an exception raising in one of the finalizers.
Expected (no KeyboardInterrupt):
Observed (with KeyboardInterrupt):
Note the missing pytest_runtest_teardown pre and post, session fixture teardown, and sessionfinish.
In both these cases, I expect teardown to proceed the same (runtest_teardown.pre, fixture teardown, runtest_teardown.post, session fixture teardown, sessionfinish), regardless of a KeyboardInterrupt.
Am I missing an option to force teardown, even with KeyboardInterrupt?
Source:
conftest.py:
test_teardown_stack.py:
The text was updated successfully, but these errors were encountered: