(self)
| 159 | |
| 160 | class TestTracebackEntry: |
| 161 | def test_getsource(self) -> None: |
| 162 | try: |
| 163 | if False: |
| 164 | pass |
| 165 | else: |
| 166 | assert False |
| 167 | except AssertionError: |
| 168 | exci = ExceptionInfo.from_current() |
| 169 | entry = exci.traceback[0] |
| 170 | source = entry.getsource() |
| 171 | assert source is not None |
| 172 | assert len(source) == 6 |
| 173 | assert "assert False" in source[5] |
| 174 | |
| 175 | def test_tb_entry_str(self): |
| 176 | try: |
nothing calls this directly
no test coverage detected