Skip to content

Commit

Permalink
Fix compatibility with pytest 8.2 FixtureDef.unittest removal
Browse files Browse the repository at this point in the history
Since pytest 8.2 unittest and regular behave the same, so unittest
special handling is no longer needed.
  • Loading branch information
bluetech committed Mar 9, 2024
1 parent f459948 commit 649bbe5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pytest_asyncio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ def _wrap_asyncgen_fixture(fixturedef: FixtureDef, event_loop_fixture_id: str) -

@functools.wraps(fixture)
def _asyncgen_fixture_wrapper(request: FixtureRequest, **kwargs: Any):
unittest = False if pytest.version_tuple >= (8, 2) else fixturedef.unittest
func = _perhaps_rebind_fixture_func(
fixture, request.instance, fixturedef.unittest
fixture, request.instance, unittest
)
event_loop = kwargs.pop(event_loop_fixture_id)
gen_obj = func(
Expand Down Expand Up @@ -355,8 +356,9 @@ def _wrap_async_fixture(fixturedef: FixtureDef, event_loop_fixture_id: str) -> N

@functools.wraps(fixture)
def _async_fixture_wrapper(request: FixtureRequest, **kwargs: Any):
unittest = False if pytest.version_tuple >= (8, 2) else fixturedef.unittest
func = _perhaps_rebind_fixture_func(
fixture, request.instance, fixturedef.unittest
fixture, request.instance, unittest
)
event_loop = kwargs.pop(event_loop_fixture_id)

Expand Down

0 comments on commit 649bbe5

Please sign in to comment.