We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e2d5d2 commit 694ebe2Copy full SHA for 694ebe2
pytest_asyncio/plugin.py
@@ -288,7 +288,7 @@ def pytest_pyfunc_call(pyfuncitem):
288
where the wrapped test coroutine is executed in an event loop.
289
"""
290
if "asyncio" in pyfuncitem.keywords:
291
- if getattr(pyfuncitem.obj, "is_hypothesis_test", False):
+ if _is_hypothesis_test(pyfuncitem.obj):
292
pyfuncitem.obj.hypothesis.inner_test = wrap_in_sync(
293
pyfuncitem.obj.hypothesis.inner_test,
294
_loop=pyfuncitem.funcargs["event_loop"],
@@ -300,6 +300,10 @@ def pytest_pyfunc_call(pyfuncitem):
300
yield
301
302
303
+def _is_hypothesis_test(function) -> bool:
304
+ return getattr(function, "is_hypothesis_test", False)
305
+
306
307
def wrap_in_sync(func, _loop):
308
"""Return a sync wrapper around an async function executing it in the
309
current event loop."""
0 commit comments