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

Method test_internalerror

testing/test_terminal.py:111–117  ·  view source on GitHub ↗
(self, pytester: Pytester, linecomp)

Source from the content-addressed store, hash-verified

109 )
110
111 def test_internalerror(self, pytester: Pytester, linecomp) -> None:
112 modcol = pytester.getmodulecol("def test_one(): pass")
113 rep = TerminalReporter(modcol.config, file=linecomp.stringio)
114 with pytest.raises(ValueError) as excinfo:
115 raise ValueError("hello")
116 rep.pytest_internalerror(excinfo.getrepr())
117 linecomp.assert_contains_lines(["INTERNALERROR> *ValueError*hello*"])
118
119 def test_writeline(self, pytester: Pytester, linecomp) -> None:
120 modcol = pytester.getmodulecol("def test_one(): pass")

Callers

nothing calls this directly

Calls 5

pytest_internalerrorMethod · 0.95
TerminalReporterClass · 0.90
getreprMethod · 0.80
assert_contains_linesMethod · 0.80
getmodulecolMethod · 0.45

Tested by

no test coverage detected