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

Function test_getfuncsource_dynamic

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

Source from the content-addressed store, hash-verified

245
246
247def test_getfuncsource_dynamic() -> None:
248 def f():
249 raise NotImplementedError()
250
251 def g():
252 pass # pragma: no cover
253
254 f_source = Source(f)
255 g_source = Source(g)
256 assert str(f_source).strip() == "def f():\n raise NotImplementedError()"
257 assert str(g_source).strip() == "def g():\n pass # pragma: no cover"
258
259
260def test_getfuncsource_with_multine_string() -> None:

Callers

nothing calls this directly

Calls 2

SourceClass · 0.90
stripMethod · 0.80

Tested by

no test coverage detected