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

Method test_internalerror

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

Source from the content-addressed store, hash-verified

141 assert "INTERNALERROR" not in combined
142
143 def test_internalerror(self, pytester: Pytester, linecomp) -> None:
144 modcol = pytester.getmodulecol("def test_one(): pass")
145 rep = TerminalReporter(modcol.config, file=linecomp.stringio)
146 with pytest.raises(ValueError) as excinfo:
147 raise ValueError("hello")
148 rep.pytest_internalerror(excinfo.getrepr())
149 linecomp.assert_contains_lines(["INTERNALERROR> *ValueError*hello*"])
150
151 def test_writeline(self, pytester: Pytester, linecomp) -> None:
152 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