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

Function test_warning_register

tests/test_warnings.py:52–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51
52def test_warning_register():
53 assert m.CustomWarning is not None
54
55 with pytest.warns(m.CustomWarning) as excinfo:
56 warnings.warn("This is warning from Python!", m.CustomWarning, stacklevel=1)
57
58 assert issubclass(excinfo[0].category, DeprecationWarning)
59 assert str(excinfo[0].message) == "This is warning from Python!"
60
61
62def test_warning_custom():

Callers

nothing calls this directly

Calls 1

strClass · 0.85

Tested by

no test coverage detected