def test_register_dtype(): from pybind11_tests import register_dtype with pytest.raises(RuntimeError) as excinfo: register_dtype() if 'dtype is already registered' not in str(excinfo.value): raise AssertionError
def test_register_dtype(): from pybind11_tests import register_dtype with pytest.raises(RuntimeError) as excinfo: register_dtype() assert 'dtype is already registered' in str(excinfo.value)