mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 14:59:27 +00:00
Add exception translation for std::overflow_error. (#1977)
This commit is contained in:
committed by
Wenzel Jakob
parent
55ff464233
commit
deb3cb238a
@@ -79,6 +79,10 @@ def test_custom(msg):
|
||||
m.throws_logic_error()
|
||||
assert msg(excinfo.value) == "this error should fall through to the standard handler"
|
||||
|
||||
# OverFlow error translation.
|
||||
with pytest.raises(OverflowError) as excinfo:
|
||||
m.throws_overflow_error()
|
||||
|
||||
# Can we handle a helper-declared exception?
|
||||
with pytest.raises(m.MyException5) as excinfo:
|
||||
m.throws5()
|
||||
|
||||
Reference in New Issue
Block a user