File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -323,10 +323,14 @@ def test_compare_buffer_info():
323323
324324@pytest .requires_numpy
325325def test_numpy_bool ():
326- from pybind11_tests import bool_passthrough as convert , bool_passthrough_noconvert as noconvert
326+ from pybind11_tests import (bool_passthrough as convert ,
327+ bool_passthrough_noconvert as noconvert )
327328
328- require_implicit = lambda v : pytest .raises (TypeError , noconvert , v )
329- cant_convert = lambda v : pytest .raises (TypeError , convert , v )
329+ def require_implicit (v ):
330+ pytest .raises (TypeError , noconvert , v )
331+
332+ def cant_convert (v ):
333+ pytest .raises (TypeError , convert , v )
330334
331335 # straight up bool
332336 assert convert (True ) is True
@@ -356,9 +360,14 @@ def test_numpy_bool():
356360 assert convert ('foo' ) is True
357361
358362 class A (object ):
359- def __init__ (self , x ): self .x = x
360- def __nonzero__ (self ): return self .x
361- __bool__ = __nonzero__
363+ def __init__ (self , x ):
364+ self .x = x
365+
366+ def __nonzero__ (self ):
367+ return self .x
368+
369+ def __bool__ (self ):
370+ return self .x
362371
363372 class B (object ):
364373 pass
You can’t perform that action at this time.
0 commit comments