()
| 39 | |
| 40 | |
| 41 | def test_warning_double_register_fail(): |
| 42 | with pytest.raises(Exception) as excinfo: |
| 43 | m.register_duplicate_warning() |
| 44 | |
| 45 | assert issubclass(excinfo.type, RuntimeError) |
| 46 | assert ( |
| 47 | str(excinfo.value) |
| 48 | == 'pybind11::warnings::new_warning_type(): an attribute with name "CustomWarning" exists already.' |
| 49 | ) |
| 50 | |
| 51 | |
| 52 | def test_warning_register(): |