MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_traceback_cut

Method test_traceback_cut

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

from_functionMethod · 0.80
cutMethod · 0.80

Tested by

no test coverage detected