Correctly handle tracebackhide for chained exceptions (#10772)
This commit is contained in:
@@ -294,6 +294,7 @@ class TestTraceback_f_g_h:
|
||||
excinfo = pytest.raises(ValueError, f)
|
||||
tb = excinfo.traceback
|
||||
entry = tb.getcrashentry()
|
||||
assert entry is not None
|
||||
co = _pytest._code.Code.from_function(h)
|
||||
assert entry.frame.code.path == co.path
|
||||
assert entry.lineno == co.firstlineno + 1
|
||||
@@ -311,10 +312,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():
|
||||
|
||||
Reference in New Issue
Block a user