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

Function test_getstartingblock_multiline

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

Source from the content-addressed store, hash-verified

641
642
643def test_getstartingblock_multiline() -> None:
644 class A:
645 def __init__(self, *args):
646 frame = sys._getframe(1)
647 self.source = Frame(frame).statement
648
649 # fmt: off
650 x = A('x',
651 'y'
652 ,
653 'z')
654 # fmt: on
655 values = [i for i in x.source.lines if i.strip()]
656 assert len(values) == 4

Callers

nothing calls this directly

Calls 2

stripMethod · 0.80
AClass · 0.70

Tested by

no test coverage detected