If provided, use the custom message in the raised error
(self)
| 1329 | assert e_from_wrapped.value.args == e.value.args |
| 1330 | |
| 1331 | def test_custom_msg(self): |
| 1332 | """ |
| 1333 | If provided, use the custom message in the raised error |
| 1334 | """ |
| 1335 | custom_msg = "custom message!" |
| 1336 | wrapped = in_("abc") |
| 1337 | v = not_(wrapped, msg=custom_msg) |
| 1338 | a = simple_attr("test") |
| 1339 | input_value = "a" |
| 1340 | |
| 1341 | with pytest.raises(ValueError) as e: |
| 1342 | v(None, a, input_value) |
| 1343 | |
| 1344 | assert ( |
| 1345 | custom_msg, |
| 1346 | a, |
| 1347 | wrapped, |
| 1348 | input_value, |
| 1349 | self.DEFAULT_EXC_TYPES, |
| 1350 | ) == e.value.args |
| 1351 | |
| 1352 | def test_bad_exception_args(self): |
| 1353 | """ |
nothing calls this directly
no test coverage detected