If the exception doesn't match, the underlying raise comes through
(self)
| 1308 | v(None, a, "d") |
| 1309 | |
| 1310 | def test_custom_capture_miss(self): |
| 1311 | """ |
| 1312 | If the exception doesn't match, the underlying raise comes through |
| 1313 | """ |
| 1314 | |
| 1315 | class MyError(Exception): |
| 1316 | """:(""" |
| 1317 | |
| 1318 | wrapped = in_("abc") |
| 1319 | v = not_(wrapped, exc_types=MyError) |
| 1320 | a = simple_attr("test") |
| 1321 | input_value = "d" |
| 1322 | |
| 1323 | with pytest.raises(ValueError) as e: |
| 1324 | v(None, a, input_value) |
| 1325 | |
| 1326 | # get the underlying exception to compare |
| 1327 | with pytest.raises(Exception) as e_from_wrapped: |
| 1328 | wrapped(None, a, input_value) |
| 1329 | assert e_from_wrapped.value.args == e.value.args |
| 1330 | |
| 1331 | def test_custom_msg(self): |
| 1332 | """ |
nothing calls this directly
no test coverage detected