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

Function test_warning_custom

tests/test_warnings.py:62–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60
61
62def test_warning_custom():
63 with pytest.warns(m.CustomWarning) as excinfo:
64 value = m.warn_with_custom_type()
65
66 assert issubclass(excinfo[0].category, DeprecationWarning)
67 assert str(excinfo[0].message) == "This is CustomWarning"
68 assert value == 37

Callers

nothing calls this directly

Calls 1

strClass · 0.85

Tested by

no test coverage detected