From 377ef7feb2414c78642440fab59d43f3d3646d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Hofst=C3=A4tter?= Date: Sat, 11 Mar 2023 11:39:02 +0100 Subject: [PATCH] fix test that was assuming wrong return value for getcrashentry * The test still assumed that Traceback.getcrashentry would return the last element from the traceback when all elements were hidden. However, that was erroneous behavior which was fixed in a583c68e150626340b41d890ffd9f3049e5c83ff --- testing/code/test_excinfo.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index e428b9c5c..b102f1006 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -311,10 +311,7 @@ class TestTraceback_f_g_h: excinfo = pytest.raises(ValueError, f) tb = excinfo.traceback entry = tb.getcrashentry() - co = _pytest._code.Code.from_function(g) - assert entry.frame.code.path == co.path - assert entry.lineno == co.firstlineno + 2 - assert entry.frame.code.name == "g" + assert entry is None def test_excinfo_exconly():