From 067d8facd81b49d1f84adf830f4b584371bf1cf4 Mon Sep 17 00:00:00 2001 From: Myp3a Date: Fri, 6 Dec 2024 14:40:24 +0300 Subject: [PATCH] chore: explanations --- src/_pytest/nodes.py | 3 ++- testing/acceptance_test.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index c920800df1f..d5ff3a87edb 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 9f09a6be93a..ad829889c50 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)