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

Function test_warning_simple

tests/test_warnings.py:19–27  ·  view source on GitHub ↗
(
    expected_category, expected_message, expected_value, module_function
)

Source from the content-addressed store, hash-verified

17 ],
18)
19def test_warning_simple(
20 expected_category, expected_message, expected_value, module_function
21):
22 with pytest.warns(Warning, match="This is") as excinfo:
23 value = module_function()
24
25 assert issubclass(excinfo[0].category, expected_category)
26 assert str(excinfo[0].message) == expected_message
27 assert value == expected_value
28
29
30def test_warning_wrong_subclass_fail():

Callers

nothing calls this directly

Calls 1

strClass · 0.85

Tested by

no test coverage detected