()
| 28 | |
| 29 | |
| 30 | def test_warning_wrong_subclass_fail(): |
| 31 | with pytest.raises(Exception) as excinfo: |
| 32 | m.warn_with_invalid_category() |
| 33 | |
| 34 | assert issubclass(excinfo.type, RuntimeError) |
| 35 | assert ( |
| 36 | str(excinfo.value) |
| 37 | == "pybind11::warnings::warn(): cannot raise warning, category must be a subclass of PyExc_Warning!" |
| 38 | ) |
| 39 | |
| 40 | |
| 41 | def test_warning_double_register_fail(): |