MCPcopy
hub / github.com/Textualize/rich / test_traceback_finely_grained

Function test_traceback_finely_grained

tests/test_traceback.py:348–360  ·  view source on GitHub ↗

Check that last instruction is populated.

()

Source from the content-addressed store, hash-verified

346 sys.version_info.minor < 11, reason="Not applicable before Python 3.11"
347)
348def test_traceback_finely_grained() -> None:
349 """Check that last instruction is populated."""
350 try:
351 1 / 0
352 except:
353 traceback = Traceback()
354 last_instruction = traceback.trace.stacks[-1].frames[-1].last_instruction
355 assert last_instruction is not None
356 assert isinstance(last_instruction, tuple)
357 assert len(last_instruction) == 2
358 start, end = last_instruction
359 print(start, end)
360 assert start[0] == end[0]
361
362
363@pytest.mark.skipif(

Callers

nothing calls this directly

Calls 2

TracebackClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected