Check that last instruction is populated.
()
| 346 | sys.version_info.minor < 11, reason="Not applicable before Python 3.11" |
| 347 | ) |
| 348 | def 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( |