Skip to content

Commit

Permalink
chore: explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
Myp3a committed Dec 6, 2024
1 parent d5a146f commit 067d8fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/_pytest/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def __init__(
# Deprecated alias. Was never public. Can be removed in a few releases.
self._store = self.stash

#: A list of exceptions that happened during teardown
#: A list of exceptions that happened during teardown. Intended for
#: post-teardown inspection, not required internally.
self.teardown_exceptions: list[BaseException] = []

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions testing/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,4 +1608,6 @@ def test_func(mylist):
result = pytester.runpytest()
assert result.ret == ExitCode.TESTS_FAILED
assert "teardown_exceptions: `[AssertionError(111)]`" in result.stderr.str()
# Related to the #9909 - first the test passes, then the teardown fails, what
# results in a double-reporting.
result.assert_outcomes(passed=1, errors=1)

0 comments on commit 067d8fa

Please sign in to comment.