diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 1fb0190bf3b..9f09a6be93a 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1593,9 +1593,8 @@ def test_get_exception_on_teardown_failure(pytester: Pytester) -> None: import sys import pytest def pytest_exception_interact(node, call, report): - sys.stderr.write("{}".format(node.teardown_exceptions)) + sys.stderr.write("teardown_exceptions: `{}`".format(node.teardown_exceptions)) - import pytest @pytest.fixture def mylist(): yield @@ -1608,5 +1607,5 @@ def test_func(mylist): ) result = pytester.runpytest() assert result.ret == ExitCode.TESTS_FAILED - assert "AssertionError(111)" in result.stderr.str() - result.stdout.fnmatch_lines(["*1 error*"]) + assert "teardown_exceptions: `[AssertionError(111)]`" in result.stderr.str() + result.assert_outcomes(passed=1, errors=1)