Skip to content

Commit 258d0a7

Browse files
committed
.
1 parent fe69a5c commit 258d0a7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/integrations/aiohttp/test_aiohttp.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
from unittest import mock
66

77
import pytest
8+
9+
try:
10+
import pytest_asyncio
11+
except ImportError:
12+
pytest_asyncio = None
13+
814
from aiohttp import web, ClientSession
915
from aiohttp.client import ServerDisconnectedError
1016
from aiohttp.web_request import Request
@@ -21,6 +27,14 @@
2127
from tests.conftest import ApproxDict
2228

2329

30+
if pytest_asyncio is None:
31+
# `loop` was deprecated in `pytest-aiohttp`
32+
# in favor of `event_loop` from `pytest-asyncio`
33+
@pytest.fixture
34+
def event_loop(loop):
35+
yield loop
36+
37+
2438
@pytest.mark.asyncio
2539
async def test_basic(sentry_init, aiohttp_client, capture_events):
2640
sentry_init(integrations=[AioHttpIntegration()])

0 commit comments

Comments
 (0)