diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index c920800df1..d5ff3a87ed 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -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 diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 9f09a6be93..ad829889c5 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -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)