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

Function test_source_from_method

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

Source from the content-addressed store, hash-verified

41
42
43def test_source_from_method() -> None:
44 class TestClass:
45 def test_method(self):
46 pass
47
48 source = Source(TestClass().test_method)
49 assert source.lines == ["def test_method(self):", " pass"]
50
51
52def test_source_from_lines() -> None:

Callers

nothing calls this directly

Calls 2

SourceClass · 0.90
TestClassClass · 0.70

Tested by

no test coverage detected