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(
259259 _make_asyncio_fixture_function (func , loop_scope )
260260 if "request" not in fixturedef .argnames :
261261 fixturedef .argnames += ("request" ,)
262- _synchronize_async_fixture (fixturedef )
262+ fixturedef . func = _fixture_synchronizer (fixturedef ) # type: ignore[misc]
263263 assert _is_asyncio_fixture_function (fixturedef .func )
264264 processed_fixturedefs .add (fixturedef )
265265
266266
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."""
269269 if inspect .isasyncgenfunction (fixturedef .func ):
270- fixturedef . func = _wrap_asyncgen_fixture (fixturedef .func ) # type: ignore[misc]
270+ return _wrap_asyncgen_fixture (fixturedef .func )
271271 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
273275
274276
275277def _add_kwargs (
You can’t perform that action at this time.
0 commit comments