From 43cbb6ffc9316b138a8f5de63206ec0b7a44ec0b Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 18 Jan 2022 00:08:09 +0200 Subject: [PATCH] Code cleanup: drop 'request' argument from async fixtures --- pytest_asyncio/plugin.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index 89151971..d3922ade 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -232,7 +232,6 @@ def _hypothesis_test_wraps_coroutine(function: Any) -> bool: class FixtureStripper: """Include additional Fixture, and then strip them""" - REQUEST = "request" EVENT_LOOP = "event_loop" def __init__(self, fixturedef: FixtureDef) -> None: @@ -330,15 +329,11 @@ def pytest_fixture_setup( fixture_stripper = FixtureStripper(fixturedef) fixture_stripper.add(FixtureStripper.EVENT_LOOP) - fixture_stripper.add(FixtureStripper.REQUEST) def wrapper(*args, **kwargs): loop = fixture_stripper.get_and_strip_from( FixtureStripper.EVENT_LOOP, kwargs ) - request = fixture_stripper.get_and_strip_from( - FixtureStripper.REQUEST, kwargs - ) gen_obj = generator(*args, **kwargs) @@ -452,7 +447,7 @@ def pytest_runtest_setup(item: pytest.Item) -> None: if "event_loop" in fixturenames: fixturenames.remove("event_loop") fixturenames.insert(0, "event_loop") - obj = getattr(item, 'obj', None) + obj = getattr(item, "obj", None) if ( item.get_closest_marker("asyncio") is not None and not getattr(obj, "hypothesis", False)