Confusing AssertionError
when using request.getfixturevalue
with new fixture during teardown
#12882
Labels
topic: fixtures
anything involving fixtures directly or indirectly
topic: reporting
related to terminal output and user-facing messages and errors
With 8.3.3 (as well as the current
main
, f373974), something likeresults in a rather confusing internal
AssertionError
from pytest:which is here:
pytest/src/_pytest/runner.py
Lines 519 to 527 in d0f136f
This seems similar to what has been reported (and improved) by @petebman here:
and indeed, also requesting
tmp_path
from the test (afterfixt
, so it's torn down first) leads to a much better error message:From what I can gather, what happens here instead is:
tmp_path
fixt
requests it during teardowntmp_path
with the current test nodeAssertionError
In the actual context we saw this in qutebrowser, this was made even more difficult to debug:
__tracebackhide__
in my code?!) decided to just show:without a full traceback.
The text was updated successfully, but these errors were encountered: