Skip to content

Commit 048a6ed

Browse files
authored
Code cleanup: drop 'request' argument from async fixtures (#270)
1 parent 4353327 commit 048a6ed

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pytest_asyncio/plugin.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ def _hypothesis_test_wraps_coroutine(function: Any) -> bool:
232232
class FixtureStripper:
233233
"""Include additional Fixture, and then strip them"""
234234

235-
REQUEST = "request"
236235
EVENT_LOOP = "event_loop"
237236

238237
def __init__(self, fixturedef: FixtureDef) -> None:
@@ -330,15 +329,11 @@ def pytest_fixture_setup(
330329

331330
fixture_stripper = FixtureStripper(fixturedef)
332331
fixture_stripper.add(FixtureStripper.EVENT_LOOP)
333-
fixture_stripper.add(FixtureStripper.REQUEST)
334332

335333
def wrapper(*args, **kwargs):
336334
loop = fixture_stripper.get_and_strip_from(
337335
FixtureStripper.EVENT_LOOP, kwargs
338336
)
339-
request = fixture_stripper.get_and_strip_from(
340-
FixtureStripper.REQUEST, kwargs
341-
)
342337

343338
gen_obj = generator(*args, **kwargs)
344339

@@ -452,7 +447,7 @@ def pytest_runtest_setup(item: pytest.Item) -> None:
452447
if "event_loop" in fixturenames:
453448
fixturenames.remove("event_loop")
454449
fixturenames.insert(0, "event_loop")
455-
obj = getattr(item, 'obj', None)
450+
obj = getattr(item, "obj", None)
456451
if (
457452
item.get_closest_marker("asyncio") is not None
458453
and not getattr(obj, "hypothesis", False)

0 commit comments

Comments
 (0)