()
| 230 | |
| 231 | |
| 232 | def test_getline_finally() -> None: |
| 233 | def c() -> None: |
| 234 | pass |
| 235 | |
| 236 | with pytest.raises(TypeError) as excinfo: |
| 237 | teardown = None |
| 238 | try: |
| 239 | c(1) # type: ignore |
| 240 | finally: |
| 241 | if teardown: |
| 242 | teardown() # type: ignore[unreachable] |
| 243 | source = excinfo.traceback[-1].statement |
| 244 | assert str(source).strip() == "c(1) # type: ignore" |
| 245 | |
| 246 | |
| 247 | def test_getfuncsource_dynamic() -> None: |