MCPcopy
hub / github.com/pytest-dev/pytest / test_traceback_cut

Method test_traceback_cut

testing/code/test_excinfo.py:173–181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 2

from_functionMethod · 0.80
cutMethod · 0.80

Tested by

no test coverage detected