Skip to content

Commit 0170b4a

Browse files
committed
linting
1 parent 9614d83 commit 0170b4a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

pytest_twisted.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,26 @@ def pytest_pyfunc_call(pyfuncitem):
367367
# from arbitrary tests so we kinda have to keep this up for now
368368
maybe_hypothesis = getattr(pyfuncitem.obj, "hypothesis", None)
369369
if maybe_hypothesis is None:
370-
_run_inline_callbacks(_async_pytest_pyfunc_call, pyfuncitem, pyfuncitem.obj, {})
370+
_run_inline_callbacks(
371+
_async_pytest_pyfunc_call,
372+
pyfuncitem,
373+
pyfuncitem.obj,
374+
{}
375+
)
371376
result = not None
372377
else:
373378
hypothesis = maybe_hypothesis
374379
f = hypothesis.inner_test
375-
pyfuncitem.obj.hypothesis.inner_test = lambda **kwargs: _run_inline_callbacks(_async_pytest_pyfunc_call, pyfuncitem, f, kwargs)
380+
381+
def inner_test(**kwargs):
382+
return _run_inline_callbacks(
383+
_async_pytest_pyfunc_call,
384+
pyfuncitem,
385+
f,
386+
kwargs,
387+
)
388+
389+
pyfuncitem.obj.hypothesis.inner_test = inner_test
376390
result = None
377391

378392
return result

testing/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def skip_if_no_async_generators():
9696
def skip_if_hypothesis_unavailable():
9797
def hypothesis_unavailable():
9898
try:
99-
import hypothesis
99+
import hypothesis # noqa: F401
100100
except ImportError:
101101
return True
102102

0 commit comments

Comments
 (0)