Add exception translation for std::overflow_error. (#1977)

This commit is contained in:
Francesco Biscani
2019-11-14 08:56:58 +01:00
committed by Wenzel Jakob
parent 55ff464233
commit deb3cb238a
4 changed files with 8 additions and 0 deletions

View File

@@ -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()