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

Method test_raises_false_and_arg

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

Source from the content-addressed store, hash-verified

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
44 def test_raises_false_and_arg(self):
45 with pytest.raises(
46 ValueError,
47 match=wrap_escape(
48 "Expected an exception type or a tuple of exception types, but got `False`. "
49 "Raising exceptions is already understood as failing the test, so you don't need "
50 "any special code to say 'this should never raise an exception'."
51 ),
52 ):
53 pytest.raises(False, int) # type: ignore[call-overload]
54
55 def test_raises_does_not_allow_empty_tuple(self):
56 with pytest.raises(

Callers

nothing calls this directly

Calls 1

wrap_escapeFunction · 0.70

Tested by

no test coverage detected