Skip to content

Commit dad8e86

Browse files
committed
fixes loop aiohttp
1 parent 407917c commit dad8e86

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

services/web/server/tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# pylint: disable=unused-argument
44
# pylint: disable=unused-variable
55

6+
import asyncio
67
import contextlib
78
import json
89
import logging
@@ -487,3 +488,9 @@ def mock_dynamic_scheduler(mocker: MockerFixture) -> None:
487488
"simcore_service_webserver.dynamic_scheduler.api.update_projects_networks",
488489
autospec=True,
489490
)
491+
492+
493+
@pytest.fixture
494+
async def loop() -> asyncio.AbstractEventLoop:
495+
"""Override the event loop inside pytest-aiohttp with the one from pytest-asyncio."""
496+
return asyncio.get_running_loop()

services/web/server/tests/unit/isolated/test_exception_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async def _handler(request: web.Request):
9898
app.add_routes(routes)
9999

100100
# 3. testing from the client side
101-
client: TestClient = await aiohttp_client(app)
101+
client = await aiohttp_client(app)
102102

103103
# success
104104
resp = await client.post("/ok")

0 commit comments

Comments
 (0)