Skip to content

Commit 0edb5a0

Browse files
committed
fix aiohttp tests again
1 parent 2e480c9 commit 0edb5a0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/integrations/aiohttp/test_aiohttp.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import json
3+
import sys
34
from contextlib import suppress
45
from unittest import mock
56

@@ -473,9 +474,22 @@ async def hello(request):
473474
assert error_event["contexts"]["trace"]["trace_id"] == trace_id
474475

475476

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+
485+
@pytest.fixture
486+
def asyncio_loop(loop):
487+
yield loop
488+
489+
476490
@pytest.mark.asyncio
477491
async def test_crumb_capture(
478-
sentry_init, aiohttp_raw_server, aiohttp_client, event_loop, capture_events
492+
sentry_init, aiohttp_raw_server, aiohttp_client, asyncio_loop, capture_events
479493
):
480494
def before_breadcrumb(crumb, hint):
481495
crumb["data"]["extra"] = "foo"

0 commit comments

Comments
 (0)