@@ -60,7 +60,7 @@ def test_shared_ptr_gc():
60
60
assert i == v .value ()
61
61
62
62
63
- def test_no_id (capture , msg ):
63
+ def test_no_id (msg ):
64
64
from pybind11_tests .issues import get_element , expect_float , expect_int
65
65
66
66
with pytest .raises (TypeError ) as excinfo :
@@ -147,6 +147,7 @@ def test_move_fallback():
147
147
m1 = get_moveissue1 (1 )
148
148
assert m1 .value == 1
149
149
150
+
150
151
def test_override_ref ():
151
152
from pybind11_tests .issues import OverrideTest
152
153
o = OverrideTest ("asdf" )
@@ -162,6 +163,7 @@ def test_override_ref():
162
163
a .value = "bye"
163
164
assert a .value == "bye"
164
165
166
+
165
167
def test_operators_notimplemented (capture ):
166
168
from pybind11_tests .issues import OpTest1 , OpTest2
167
169
with capture :
@@ -175,6 +177,7 @@ def test_operators_notimplemented(capture):
175
177
Add OpTest2 with OpTest1
176
178
Add OpTest2 with OpTest1"""
177
179
180
+
178
181
def test_iterator_rvpolicy ():
179
182
""" Issue 388: Can't make iterators via make_iterator() with different r/v policies """
180
183
from pybind11_tests .issues import make_iterator_1
@@ -184,6 +187,7 @@ def test_iterator_rvpolicy():
184
187
assert list (make_iterator_2 ()) == [1 , 2 , 3 ]
185
188
assert (type (make_iterator_1 ()) != type (make_iterator_2 ()))
186
189
190
+
187
191
def test_dupe_assignment ():
188
192
""" Issue 461: overwriting a class with a function """
189
193
from pybind11_tests .issues import dupe_exception_failures
@@ -202,6 +206,7 @@ def test_enable_shared_from_this_with_reference_rvp():
202
206
del child , parent
203
207
assert cstats .alive () == 0
204
208
209
+
205
210
def test_non_destructed_holders ():
206
211
""" Issue #478: unique ptrs constructed and freed without destruction """
207
212
from pybind11_tests import SpecialHolderObj
@@ -218,3 +223,17 @@ def test_non_destructed_holders():
218
223
assert cstats .alive () == 1
219
224
del a
220
225
assert cstats .alive () == 0
226
+
227
+
228
+ def test_complex_cast (capture ):
229
+ """ Issue #484: number conversion generates unhandled exceptions """
230
+ from pybind11_tests .issues import test_complex
231
+
232
+ with capture :
233
+ test_complex (1 )
234
+ test_complex (2j )
235
+
236
+ assert capture == """
237
+ 1.0
238
+ (0.0, 2.0)
239
+ """
0 commit comments