MCPcopy
hub / github.com/python-attrs/attrs / test_bad_exception_args

Method test_bad_exception_args

tests/test_validators.py:1352–1364  ·  view source on GitHub ↗

Malformed exception arguments

(self)

Source from the content-addressed store, hash-verified

1350 ) == e.value.args
1351
1352 def test_bad_exception_args(self):
1353 """
1354 Malformed exception arguments
1355 """
1356 wrapped = in_("abc")
1357
1358 with pytest.raises(TypeError) as e:
1359 not_(wrapped, exc_types=(str, int))
1360
1361 assert (
1362 "'exc_types' must be a subclass of <class 'Exception'> "
1363 "(got <class 'str'>)."
1364 ) == e.value.args[0]
1365
1366
1367class TestOr:

Callers

nothing calls this directly

Calls 2

in_Function · 0.90
not_Function · 0.90

Tested by

no test coverage detected