(self)
| 171 | ] |
| 172 | |
| 173 | def test_traceback_cut(self) -> None: |
| 174 | co = _pytest._code.Code.from_function(f) |
| 175 | path, firstlineno = co.path, co.firstlineno |
| 176 | assert isinstance(path, Path) |
| 177 | traceback = self.excinfo.traceback |
| 178 | newtraceback = traceback.cut(path=path, firstlineno=firstlineno) |
| 179 | assert len(newtraceback) == 1 |
| 180 | newtraceback = traceback.cut(path=path, lineno=firstlineno + 2) |
| 181 | assert len(newtraceback) == 1 |
| 182 | |
| 183 | def test_traceback_cut_excludepath(self, pytester: Pytester) -> None: |
| 184 | p = pytester.makepyfile("def f(): raise ValueError") |
nothing calls this directly
no test coverage detected