Lines Matching refs:excinfo
11 with pytest.raises(RuntimeError) as excinfo:
13 assert msg(excinfo.value) == "This exception was intentionally thrown."
17 with pytest.raises(RuntimeError) as excinfo:
19 assert msg(excinfo.value) == "Unknown internal error occurred"
21 with pytest.raises(ValueError) as excinfo:
23 assert msg(excinfo.value) == "foo"
27 with pytest.raises(RuntimeError) as excinfo:
29 assert str(excinfo.value) == "My runtime error"
31 with pytest.raises(ValueError) as excinfo:
33 assert str(excinfo.value) == "My value error"
35 with pytest.raises(ValueError) as excinfo:
37 assert str(excinfo.value) == "pybind11 value error"
39 with pytest.raises(TypeError) as excinfo:
41 assert str(excinfo.value) == "pybind11 type error"
43 with pytest.raises(StopIteration) as excinfo:
99 with pytest.raises(m.MyException) as excinfo:
101 assert msg(excinfo.value) == "this error should go to a custom type"
104 with pytest.raises(RuntimeError) as excinfo:
106 assert msg(excinfo.value) == "this error should go to a standard Python exception"
109 with pytest.raises(RuntimeError) as excinfo:
111 assert msg(excinfo.value) == "Caught an unknown exception!"
114 with pytest.raises(m.MyException) as excinfo:
116 assert msg(excinfo.value) == "this error is rethrown"
119 with pytest.raises(RuntimeError) as excinfo:
122 msg(excinfo.value) == "this error should fall through to the standard handler"
126 with pytest.raises(OverflowError) as excinfo:
130 with pytest.raises(m.MyException5) as excinfo:
132 assert msg(excinfo.value) == "this is a helper-defined translated exception"
135 with pytest.raises(m.MyException5) as excinfo:
137 assert msg(excinfo.value) == "MyException5 subclass"
138 assert isinstance(excinfo.value, m.MyException5_1)
140 with pytest.raises(m.MyException5_1) as excinfo:
142 assert msg(excinfo.value) == "MyException5 subclass"
144 with pytest.raises(m.MyException5) as excinfo:
149 assert msg(excinfo.value) == "this is a helper-defined translated exception"
169 with pytest.raises(m.MyException) as excinfo:
171 assert str(excinfo.value) == "nested error"
197 with pytest.raises(m.MyException5) as excinfo:
199 assert str(excinfo.value) == "this is a helper-defined translated exception"