Pytest crash when exception is raised in fixture teardown and --exitfirst flag is set #9266
Labels
topic: config
related to config handling, argument parsing and config file
topic: fixtures
anything involving fixtures directly or indirectly
type: bug
problem that needs to be addressed
Discussed in #9213
Originally posted by oleg-kondaurov October 18, 2021
When error is raised in fixture teardown,
--exitfirst
flag is set, and some additional test is still not started => Pytest crash is observed instead of a report.Use the following
tests/test2.py
file to reproduce the issue:If the
--etixfirst
flag is not set the test run returns test report with2 passed, 2 errors
, short test summary info and failed tests traces:If the
--etixfirst
flag is set pytest is crashed due to unhandled exception:The text was updated successfully, but these errors were encountered: