Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions packages/aws-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ pint==0.24.4
platformdirs==4.3.6
# via pint
pluggy==1.5.0
# via pytest
# via
# pytest
# pytest-cov
ply==3.11
# via jsonpath-ng
pprintpp==0.4.0
Expand All @@ -184,9 +186,13 @@ pydantic-core==2.27.2
# via
# -c requirements/_base.txt
# pydantic
pygments==2.19.1
# via
# -c requirements/_base.txt
# pytest
pyparsing==3.2.1
# via moto
pytest==8.3.5
pytest==8.4.1
# via
# -r requirements/_test.in
# pytest-asyncio
Expand All @@ -196,17 +202,17 @@ pytest==8.3.5
# pytest-instafail
# pytest-mock
# pytest-sugar
pytest-asyncio==0.26.0
pytest-asyncio==1.0.0
# via -r requirements/_test.in
pytest-benchmark==5.1.0
# via -r requirements/_test.in
pytest-cov==6.0.0
pytest-cov==6.2.1
# via -r requirements/_test.in
pytest-icdiff==0.9
# via -r requirements/_test.in
pytest-instafail==0.5.0
# via -r requirements/_test.in
pytest-mock==3.14.0
pytest-mock==3.14.1
# via -r requirements/_test.in
pytest-runner==6.0.1
# via -r requirements/_test.in
Expand Down
16 changes: 11 additions & 5 deletions packages/celery-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ pint==0.24.4
platformdirs==4.3.8
# via pint
pluggy==1.6.0
# via pytest
# via
# pytest
# pytest-cov
pprintpp==0.4.0
# via pytest-icdiff
prompt-toolkit==3.0.51
Expand All @@ -106,7 +108,11 @@ psutil==7.0.0
# pytest-celery
py-cpuinfo==9.0.0
# via pytest-benchmark
pytest==8.3.5
pygments==2.19.1
# via
# -c requirements/_base.txt
# pytest
pytest==8.4.1
# via
# -r requirements/_test.in
# pytest-asyncio
Expand All @@ -117,21 +123,21 @@ pytest==8.3.5
# pytest-instafail
# pytest-mock
# pytest-sugar
pytest-asyncio==0.26.0
pytest-asyncio==1.0.0
# via -r requirements/_test.in
pytest-benchmark==5.1.0
# via -r requirements/_test.in
pytest-celery==1.2.0
# via -r requirements/_test.in
pytest-cov==6.1.1
pytest-cov==6.2.1
# via -r requirements/_test.in
pytest-docker-tools==3.1.9
# via pytest-celery
pytest-icdiff==0.9
# via -r requirements/_test.in
pytest-instafail==0.5.0
# via -r requirements/_test.in
pytest-mock==3.14.0
pytest-mock==3.14.1
# via -r requirements/_test.in
pytest-runner==6.0.1
# via -r requirements/_test.in
Expand Down
1 change: 1 addition & 0 deletions packages/celery-library/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ test = pytest

[tool:pytest]
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function

[mypy]
plugins =
Expand Down
14 changes: 9 additions & 5 deletions packages/common-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ packaging==24.2
# pytest
# pytest-sugar
pluggy==1.5.0
# via pytest
# via
# pytest
# pytest-cov
pprintpp==0.4.0
# via pytest-icdiff
pydantic==2.10.6
Expand All @@ -33,7 +35,9 @@ pydantic-settings==2.7.0
# via
# -c requirements/../../../requirements/constraints.txt
# -r requirements/_test.in
pytest==8.3.5
pygments==2.19.2
# via pytest
pytest==8.4.1
# via
# -r requirements/_test.in
# pytest-asyncio
Expand All @@ -42,15 +46,15 @@ pytest==8.3.5
# pytest-instafail
# pytest-mock
# pytest-sugar
pytest-asyncio==0.26.0
pytest-asyncio==1.0.0
# via -r requirements/_test.in
pytest-cov==6.0.0
pytest-cov==6.2.1
# via -r requirements/_test.in
pytest-icdiff==0.9
# via -r requirements/_test.in
pytest-instafail==0.5.0
# via -r requirements/_test.in
pytest-mock==3.14.0
pytest-mock==3.14.1
# via -r requirements/_test.in
pytest-runner==6.0.1
# via -r requirements/_test.in
Expand Down
16 changes: 11 additions & 5 deletions packages/dask-task-models-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ pint==0.24.4
platformdirs==4.3.8
# via pint
pluggy==1.6.0
# via pytest
# via
# pytest
# pytest-cov
pprintpp==0.4.0
# via pytest-icdiff
pytest==8.3.5
pygments==2.19.1
# via
# -c requirements/_base.txt
# pytest
pytest==8.4.1
# via
# -r requirements/_test.in
# pytest-asyncio
Expand All @@ -34,15 +40,15 @@ pytest==8.3.5
# pytest-instafail
# pytest-mock
# pytest-sugar
pytest-asyncio==0.26.0
pytest-asyncio==1.0.0
# via -r requirements/_test.in
pytest-cov==6.1.1
pytest-cov==6.2.1
# via -r requirements/_test.in
pytest-icdiff==0.9
# via -r requirements/_test.in
pytest-instafail==0.5.0
# via -r requirements/_test.in
pytest-mock==3.14.0
pytest-mock==3.14.1
# via -r requirements/_test.in
pytest-runner==6.0.1
# via -r requirements/_test.in
Expand Down
14 changes: 9 additions & 5 deletions packages/models-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ pint==0.24.4
platformdirs==4.3.6
# via pint
pluggy==1.5.0
# via pytest
# via
# pytest
# pytest-cov
pprintpp==0.4.0
# via pytest-icdiff
propcache==0.3.0
# via yarl
psutil==7.0.0
# via -r requirements/_test.in
pytest==8.3.5
pygments==2.19.2
# via pytest
pytest==8.4.1
# via
# -r requirements/_test.in
# pytest-asyncio
Expand All @@ -47,15 +51,15 @@ pytest==8.3.5
# pytest-instafail
# pytest-mock
# pytest-sugar
pytest-asyncio==0.26.0
pytest-asyncio==1.0.0
# via -r requirements/_test.in
pytest-cov==6.0.0
pytest-cov==6.2.1
# via -r requirements/_test.in
pytest-icdiff==0.9
# via -r requirements/_test.in
pytest-instafail==0.5.0
# via -r requirements/_test.in
pytest-mock==3.14.0
pytest-mock==3.14.1
# via -r requirements/_test.in
pytest-runner==6.0.1
# via -r requirements/_test.in
Expand Down
6 changes: 4 additions & 2 deletions packages/models-library/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ platformdirs==4.3.6
# virtualenv
pre-commit==4.1.0
# via -r requirements/../../../requirements/devenv.txt
pygments==2.19.1
# via rich
pygments==2.19.2
# via
# -c requirements/_test.txt
# rich
pylint==3.3.4
# via -r requirements/../../../requirements/devenv.txt
pyproject-hooks==1.2.0
Expand Down
16 changes: 11 additions & 5 deletions packages/notifications-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,21 @@ packaging==24.2
pathspec==0.12.1
# via mypy
pluggy==1.5.0
# via pytest
# via
# pytest
# pytest-cov
pprintpp==0.4.0
# via pytest-icdiff
propcache==0.3.0
# via
# -c requirements/_base.txt
# aiohttp
# yarl
pytest==8.3.5
pygments==2.19.1
# via
# -c requirements/_base.txt
# pytest
pytest==8.4.1
# via
# -r requirements/_test.in
# pytest-asyncio
Expand All @@ -77,15 +83,15 @@ pytest==8.3.5
# pytest-instafail
# pytest-mock
# pytest-sugar
pytest-asyncio==0.26.0
pytest-asyncio==1.0.0
# via -r requirements/_test.in
pytest-cov==6.0.0
pytest-cov==6.2.1
# via -r requirements/_test.in
pytest-icdiff==0.9
# via -r requirements/_test.in
pytest-instafail==0.5.0
# via -r requirements/_test.in
pytest-mock==3.14.0
pytest-mock==3.14.1
# via -r requirements/_test.in
pytest-runner==6.0.1
# via -r requirements/_test.in
Expand Down
14 changes: 9 additions & 5 deletions packages/postgres-database/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,28 @@ packaging==24.2
pathspec==0.12.1
# via mypy
pluggy==1.5.0
# via pytest
# via
# pytest
# pytest-cov
psycopg2-binary==2.9.10
# via
# -c requirements/_base.txt
# aiopg
# sqlalchemy
pytest==8.3.5
pygments==2.19.2
# via pytest
pytest==8.4.1
# via
# -r requirements/_test.in
# pytest-asyncio
# pytest-cov
# pytest-docker
# pytest-instafail
pytest-asyncio==0.26.0
pytest-asyncio==1.0.0
# via -r requirements/_test.in
pytest-cov==6.0.0
pytest-cov==6.2.1
# via -r requirements/_test.in
pytest-docker==3.2.0
pytest-docker==3.2.2
# via -r requirements/_test.in
pytest-instafail==0.5.0
# via -r requirements/_test.in
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"""
Our choice of plugin to test asyncio functionality is pytest-asyncio

Some other pytest plugins, e.g. pytest-aiohttp, define their own event loop
policies and event loops, which can conflict with pytest-asyncio.

This files unifies the event loop policy and event loop used by pytest-asyncio throughout
all the tests in this repository.

"""

import asyncio

import pytest
import uvloop


@pytest.fixture(scope="session")
def event_loop_policy():
"""Override the event loop policy to use uvloop which is the one we use in production

SEE https://pytest-asyncio.readthedocs.io/en/stable/how-to-guides/uvloop.html
"""
return uvloop.EventLoopPolicy()


async def test_using_uvloop_event_loop():
"""Tests that `pytest_simcore.asyncio_event_loops` plugin is used and has an effect

Manually import and add it your test-suite to run this test.
"""
assert isinstance(asyncio.get_event_loop_policy(), uvloop.EventLoopPolicy)


@pytest.fixture
async def loop() -> asyncio.AbstractEventLoop:
"""Override the event loop inside `aiohttp.pytest_plugin` with the one from `pytest-asyncio`.

This provides the necessary fixtures to use pytest-asyncio with aiohttp!!!

USAGE:

pytest_plugins = [
"aiohttp.pytest_plugin", # No need to install pytest-aiohttp separately
]


ERRORS:
Otherwise error like this will be raised:

> if connector._loop is not loop:
> raise RuntimeError("Session and connector has to use same event loop")
E RuntimeError: Session and connector has to use same event loop

.venv/lib/python3.11/site-packages/aiohttp/client.py:375: RuntimeError

> if connector._loop is not loop:
> raise RuntimeError("Session and connector has to use same event loop")
>E RuntimeError: Session and connector has to use same event loop

.venv/lib/python3.11/site-packages/aiohttp/client.py:375: RuntimeError
"""
return asyncio.get_running_loop()
6 changes: 4 additions & 2 deletions packages/service-integration/requirements/_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ pydantic-settings==2.7.0
# -c requirements/../../../requirements/constraints.txt
# -r requirements/../../../packages/models-library/requirements/_base.in
pygments==2.19.1
# via rich
pytest==8.3.5
# via
# pytest
# rich
pytest==8.4.1
# via -r requirements/_base.in
python-dateutil==2.9.0.post0
# via arrow
Expand Down
Loading
Loading