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

Method test_raises

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

Source from the content-addressed store, hash-verified

21 pytest.raises(RuntimeError, "int('qwe')") # type: ignore[call-overload]
22
23 def test_raises(self):
24 with pytest.raises(ValueError) as excinfo:
25 int("qwe")
26 assert "invalid literal" in str(excinfo.value)
27
28 def test_raises_function(self):
29 with pytest.raises(ValueError) as excinfo:

Callers

nothing calls this directly

Calls 1

intClass · 0.85

Tested by

no test coverage detected