Skip to content

Commit 7558b2f

Browse files
committed
simplify aiohttp test fixture
1 parent 0edb5a0 commit 7558b2f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

tests/integrations/aiohttp/test_aiohttp.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -474,22 +474,17 @@ async def hello(request):
474474
assert error_event["contexts"]["trace"]["trace_id"] == trace_id
475475

476476

477-
if sys.version_info >= (3, 12):
478-
479-
@pytest.fixture
480-
def asyncio_loop(event_loop):
481-
yield event_loop
482-
483-
else:
484-
477+
if sys.version_info < (3, 12):
478+
# `loop` was deprecated in `pytest-aiohttp`
479+
# in favor of `event_loop` from `pytest-asyncio`
485480
@pytest.fixture
486-
def asyncio_loop(loop):
481+
def event_loop(loop):
487482
yield loop
488483

489484

490485
@pytest.mark.asyncio
491486
async def test_crumb_capture(
492-
sentry_init, aiohttp_raw_server, aiohttp_client, asyncio_loop, capture_events
487+
sentry_init, aiohttp_raw_server, aiohttp_client, event_loop, capture_events
493488
):
494489
def before_breadcrumb(crumb, hint):
495490
crumb["data"]["extra"] = "foo"

0 commit comments

Comments
 (0)