MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_warning_wrong_subclass_fail

Function test_warning_wrong_subclass_fail

tests/test_warnings.py:30–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29
30def 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
41def test_warning_double_register_fail():

Callers

nothing calls this directly

Calls 1

strClass · 0.85

Tested by

no test coverage detected