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

Function test_invalid_repr

tests/test_exceptions.py:269–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

267
268# This can often happen if you wrap a pybind11 class in a Python wrapper
269def test_invalid_repr():
270 class MyRepr:
271 def __repr__(self):
272 raise AttributeError("Example error")
273
274 with pytest.raises(TypeError):
275 m.simple_bool_passthrough(MyRepr())
276
277
278def test_local_translator(msg):

Callers

nothing calls this directly

Calls 1

MyReprClass · 0.85

Tested by

no test coverage detected