File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -259,17 +259,19 @@ def _preprocess_async_fixtures(
259
259
_make_asyncio_fixture_function (func , loop_scope )
260
260
if "request" not in fixturedef .argnames :
261
261
fixturedef .argnames += ("request" ,)
262
- _synchronize_async_fixture (fixturedef )
262
+ fixturedef . func = _fixture_synchronizer (fixturedef ) # type: ignore[misc]
263
263
assert _is_asyncio_fixture_function (fixturedef .func )
264
264
processed_fixturedefs .add (fixturedef )
265
265
266
266
267
- def _synchronize_async_fixture (fixturedef : FixtureDef ) -> None :
268
- """Wraps the fixture function of an async fixture in a synchronous function ."""
267
+ def _fixture_synchronizer (fixturedef : FixtureDef ) -> Callable :
268
+ """Returns a synchronous function evaluating the specified fixture."""
269
269
if inspect .isasyncgenfunction (fixturedef .func ):
270
- fixturedef . func = _wrap_asyncgen_fixture (fixturedef .func ) # type: ignore[misc]
270
+ return _wrap_asyncgen_fixture (fixturedef .func )
271
271
elif inspect .iscoroutinefunction (fixturedef .func ):
272
- fixturedef .func = _wrap_async_fixture (fixturedef .func ) # type: ignore[misc]
272
+ return _wrap_async_fixture (fixturedef .func )
273
+ else :
274
+ return fixturedef .func
273
275
274
276
275
277
def _add_kwargs (
You can’t perform that action at this time.
0 commit comments