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

Method test_raises_output

testing/test_session.py:58–69  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

56 assert out.find("does_not_work") != -1
57
58 def test_raises_output(self, pytester: Pytester) -> None:
59 reprec = pytester.inline_runsource(
60 """
61 import pytest
62 def test_raises_doesnt():
63 pytest.raises(ValueError, int, "3")
64 """
65 )
66 passed, skipped, failed = reprec.listoutcomes()
67 assert len(failed) == 1
68 out = failed[0].longrepr.reprcrash.message # type: ignore[union-attr]
69 assert "DID NOT RAISE" in out
70
71 def test_syntax_error_module(self, pytester: Pytester) -> None:
72 reprec = pytester.inline_runsource("this is really not python")

Callers

nothing calls this directly

Calls 2

listoutcomesMethod · 0.80
inline_runsourceMethod · 0.45

Tested by

no test coverage detected