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

Function test_warning_double_register_fail

tests/test_warnings.py:41–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41def 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
52def test_warning_register():

Callers

nothing calls this directly

Calls 1

strClass · 0.85

Tested by

no test coverage detected