MCPcopy
hub / github.com/pytest-dev/pytest / test_getreprcrash

Method test_getreprcrash

testing/code/test_excinfo.py:304–325  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

302 assert excinfo.traceback.recursionindex() is None
303
304 def test_getreprcrash(self):
305 def i():
306 __tracebackhide__ = True
307 raise ValueError
308
309 def h():
310 i()
311
312 def g():
313 __tracebackhide__ = True
314 h()
315
316 def f():
317 g()
318
319 with pytest.raises(ValueError) as excinfo:
320 f()
321 reprcrash = excinfo._getreprcrash()
322 assert reprcrash is not None
323 co = _pytest._code.Code.from_function(h)
324 assert reprcrash.path == str(co.path)
325 assert reprcrash.lineno == co.firstlineno + 1 + 1
326
327 def test_getreprcrash_empty(self):
328 __tracebackhide__ = True

Callers

nothing calls this directly

Calls 3

_getreprcrashMethod · 0.80
from_functionMethod · 0.80
fFunction · 0.70

Tested by

no test coverage detected