()
| 218 | |
| 219 | |
| 220 | def test_getstartingblock_singleline() -> None: |
| 221 | class A: |
| 222 | def __init__(self, *args) -> None: |
| 223 | frame = sys._getframe(1) |
| 224 | self.source = Frame(frame).statement |
| 225 | |
| 226 | x = A("x", "y") |
| 227 | |
| 228 | values = [i for i in x.source.lines if i.strip()] |
| 229 | assert len(values) == 1 |
| 230 | |
| 231 | |
| 232 | def test_getline_finally() -> None: |