(self)
| 150 | ] |
| 151 | |
| 152 | def test_traceback_cut(self) -> None: |
| 153 | co = _pytest._code.Code.from_function(f) |
| 154 | path, firstlineno = co.path, co.firstlineno |
| 155 | assert isinstance(path, Path) |
| 156 | traceback = self.excinfo.traceback |
| 157 | newtraceback = traceback.cut(path=path, firstlineno=firstlineno) |
| 158 | assert len(newtraceback) == 1 |
| 159 | newtraceback = traceback.cut(path=path, lineno=firstlineno + 2) |
| 160 | assert len(newtraceback) == 1 |
| 161 | |
| 162 | def test_traceback_cut_excludepath(self, pytester: Pytester) -> None: |
| 163 | p = pytester.makepyfile("def f(): raise ValueError") |
nothing calls this directly
no test coverage detected