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

Method test_raises

testing/python/raises.py:14–16  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12 pytest.raises(RuntimeError, "int('qwe')") # type: ignore[call-overload]
13
14 def test_raises(self):
15 excinfo = pytest.raises(ValueError, int, "qwe")
16 assert "invalid literal" in str(excinfo.value)
17
18 def test_raises_function(self):
19 excinfo = pytest.raises(ValueError, int, "hello")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected