Skip to content

Commit 047a11b

Browse files
committed
(Make flake8 happy)
1 parent 1a820a4 commit 047a11b

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/test_numpy_dtypes.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,14 @@ def test_compare_buffer_info():
323323

324324
@pytest.requires_numpy
325325
def 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

0 commit comments

Comments
 (0)