Before 3.11, the last_instruction should be None
()
| 333 | sys.version_info.minor >= 11, reason="Not applicable after Python 3.11" |
| 334 | ) |
| 335 | def test_traceback_finely_grained_missing() -> None: |
| 336 | """Before 3.11, the last_instruction should be None""" |
| 337 | try: |
| 338 | 1 / 0 |
| 339 | except: |
| 340 | traceback = Traceback() |
| 341 | last_instruction = traceback.trace.stacks[-1].frames[-1].last_instruction |
| 342 | assert last_instruction is None |
| 343 | |
| 344 | |
| 345 | @pytest.mark.skipif( |