MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_getline_finally

Function test_getline_finally

testing/code/test_source.py:232–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230
231
232def 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
247def test_getfuncsource_dynamic() -> None:

Callers

nothing calls this directly

Calls 2

stripMethod · 0.80
cFunction · 0.70

Tested by

no test coverage detected