Tests expected failure when registering a class twice with py::local in the same module
()
| 94 | |
| 95 | |
| 96 | def test_duplicate_local(): |
| 97 | """Tests expected failure when registering a class twice with py::local in the same module""" |
| 98 | with pytest.raises(RuntimeError) as excinfo: |
| 99 | m.register_local_external() |
| 100 | import pybind11_tests |
| 101 | |
| 102 | assert str(excinfo.value) == ( |
| 103 | 'generic_type: type "LocalExternal" is already registered!' |
| 104 | if hasattr(pybind11_tests, "class_") |
| 105 | else "test_class not enabled" |
| 106 | ) |
| 107 | |
| 108 | |
| 109 | def test_stl_bind_local(): |