Skip to content

Commit a95d363

Browse files
committed
✨ Add pytest_simcore.asyncio_event_loops plugin to multiple test configurations
1 parent 6aaa755 commit a95d363

File tree

18 files changed

+25
-0
lines changed

18 files changed

+25
-0
lines changed

packages/pytest-simcore/src/pytest_simcore/asyncio_event_loops.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ def event_loop_policy():
2424
return uvloop.EventLoopPolicy()
2525

2626

27+
async def test_using_uvloop_event_loop():
28+
"""Tests that `pytest_simcore.asyncio_event_loops` plugin is used and has an effect
29+
30+
Manually import and add it your test-suite to run this test.
31+
"""
32+
assert isinstance(asyncio.get_event_loop_policy(), uvloop.EventLoopPolicy)
33+
34+
2735
@pytest.fixture
2836
async def loop() -> asyncio.AbstractEventLoop:
2937
"""Override the event loop inside `aiohttp.pytest_plugin` with the one from `pytest-asyncio`.

packages/service-library/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from settings_library.redis import RedisDatabase, RedisSettings
1818

1919
pytest_plugins = [
20+
"pytest_simcore.asyncio_event_loops",
2021
"pytest_simcore.docker_compose",
2122
"pytest_simcore.docker_registry",
2223
"pytest_simcore.docker_swarm",

services/agent/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from settings_library.r_clone import S3Provider
1313

1414
pytest_plugins = [
15+
"pytest_simcore.asyncio_event_loops",
1516
"pytest_simcore.aws_server",
1617
"pytest_simcore.docker_compose",
1718
"pytest_simcore.docker_swarm",

services/api-server/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
CURRENT_DIR = Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent
1717

1818
pytest_plugins = [
19+
"pytest_simcore.asyncio_event_loops",
1920
"pytest_simcore.cli_runner",
2021
"pytest_simcore.docker_compose",
2122
"pytest_simcore.docker_swarm",

services/autoscaling/tests/unit/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
from types_aiobotocore_ec2.type_defs import TagTypeDef
101101

102102
pytest_plugins = [
103+
"pytest_simcore.asyncio_event_loops",
103104
"pytest_simcore.aws_server",
104105
"pytest_simcore.aws_ec2_service",
105106
"pytest_simcore.aws_iam_service",

services/catalog/tests/unit/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from simcore_service_catalog.core.settings import ApplicationSettings
3737

3838
pytest_plugins = [
39+
"pytest_simcore.asyncio_event_loops",
3940
"pytest_simcore.cli_runner",
4041
"pytest_simcore.docker_compose",
4142
"pytest_simcore.docker_registry",

services/clusters-keeper/tests/unit/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from types_aiobotocore_ec2.literals import InstanceTypeType
4040

4141
pytest_plugins = [
42+
"pytest_simcore.asyncio_event_loops",
4243
"pytest_simcore.aws_ec2_service",
4344
"pytest_simcore.aws_server",
4445
"pytest_simcore.docker",

services/datcore-adapter/tests/unit/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from starlette.testclient import TestClient
2626

2727
pytest_plugins = [
28+
"pytest_simcore.asyncio_event_loops",
2829
"pytest_simcore.cli_runner",
2930
"pytest_simcore.environment_configs",
3031
"pytest_simcore.repository_paths",

services/director-v2/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from starlette.testclient import ASGI3App, TestClient
3838

3939
pytest_plugins = [
40+
"pytest_simcore.asyncio_event_loops",
4041
"pytest_simcore.dask_scheduler",
4142
"pytest_simcore.db_entries_mocks",
4243
"pytest_simcore.docker_compose",

services/director/tests/unit/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
pytest_plugins = [
2121
"fixtures.fake_services",
22+
"pytest_simcore.asyncio_event_loops",
2223
"pytest_simcore.cli_runner",
2324
"pytest_simcore.docker",
2425
"pytest_simcore.docker_compose",

0 commit comments

Comments
 (0)