@@ -365,27 +365,28 @@ def pytest_pyfunc_call(pyfuncitem):
365
365
# TODO: only handle 'our' tests? what is the point of handling others?
366
366
# well, because our interface allowed people to return deferreds
367
367
# from arbitrary tests so we kinda have to keep this up for now
368
- _run_inline_callbacks (_async_pytest_pyfunc_call , pyfuncitem )
369
- return not None
368
+ f = pyfuncitem .obj .hypothesis .inner_test
369
+ pyfuncitem .obj .hypothesis .inner_test = lambda ** kwargs : _run_inline_callbacks (_async_pytest_pyfunc_call , pyfuncitem , f , kwargs )
370
+ return None
370
371
371
372
372
373
@defer .inlineCallbacks
373
- def _async_pytest_pyfunc_call (pyfuncitem ):
374
+ def _async_pytest_pyfunc_call (pyfuncitem , f , kwargs ):
374
375
"""Run test function."""
375
- kwargs = {
376
+ kwargs . update ( {
376
377
name : value
377
378
for name , value in pyfuncitem .funcargs .items ()
378
379
if name in pyfuncitem ._fixtureinfo .argnames
379
- }
380
+ })
380
381
381
- maybe_mark = _get_mark (pyfuncitem . obj )
382
+ maybe_mark = _get_mark (f )
382
383
if maybe_mark == 'async_test' :
383
- result = yield defer .ensureDeferred (pyfuncitem . obj (** kwargs ))
384
+ result = yield defer .ensureDeferred (f (** kwargs ))
384
385
elif maybe_mark == 'inline_callbacks_test' :
385
- result = yield pyfuncitem . obj (** kwargs )
386
+ result = yield f (** kwargs )
386
387
else :
387
388
# TODO: maybe deprecate this
388
- result = yield pyfuncitem . obj (** kwargs )
389
+ result = yield f (** kwargs )
389
390
390
391
defer .returnValue (result )
391
392
0 commit comments