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

Method test_raises_does_not_allow_none

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

Source from the content-addressed store, hash-verified

31 assert "invalid literal" in str(excinfo.value)
32
33 def test_raises_does_not_allow_none(self):
34 with pytest.raises(
35 ValueError,
36 match=wrap_escape("You must specify at least one parameter to match on."),
37 ):
38 # We're testing that this invalid usage gives a helpful error,
39 # so we can ignore Mypy telling us that None is invalid.
40 pytest.raises(expected_exception=None) # type: ignore
41
42 # it's unclear if this message is helpful, and if it is, should it trigger more
43 # liberally? Usually you'd get a TypeError here

Callers

nothing calls this directly

Calls 1

wrap_escapeFunction · 0.70

Tested by

no test coverage detected