diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf2b6984..511e4aede 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ENHANCEMENTS: * Update UI dependencies: `brace-expansion` to 1.1.18, `fast-uri` to 3.1.5, `immutable` to 5.1.9, `js-yaml` to 4.3.1, `nanoid` to 3.3.18, and `postcss` to 8.5.26. ([#5056](https://github.com/microsoft/AzureTRE/pull/5056)) +BUG FIXES: +* Configure the default pytest-asyncio fixture loop scope to `function` to remove the deprecation warning. ([#5055](https://github.com/microsoft/AzureTRE/pull/5055)) + ## (0.29.0) (August 14, 2026) **BREAKING CHANGES** * Remove Windows 10 and dsvm image support from Guacamole. ([#4890](https://github.com/microsoft/AzureTRE/issues/4890)) diff --git a/api_app/_version.py b/api_app/_version.py index ae62eb632..1932d0ba3 100644 --- a/api_app/_version.py +++ b/api_app/_version.py @@ -1 +1 @@ -__version__ = "0.26.5" +__version__ = "0.26.6" diff --git a/api_app/pytest.ini b/api_app/pytest.ini index 9e90ef7cb..a86e89e4b 100644 --- a/api_app/pytest.ini +++ b/api_app/pytest.ini @@ -1,3 +1,5 @@ [pytest] filterwarnings = error +asyncio_mode = strict +asyncio_default_fixture_loop_scope = function diff --git a/api_app/tests_ma/test_api/conftest.py b/api_app/tests_ma/test_api/conftest.py index 7ad45f341..35fef90a5 100644 --- a/api_app/tests_ma/test_api/conftest.py +++ b/api_app/tests_ma/test_api/conftest.py @@ -144,7 +144,7 @@ def inner(): return inner -@pytest_asyncio.fixture(scope='module') +@pytest.fixture(scope='module') def app() -> FastAPI: from main import get_application diff --git a/api_app/tests_ma/test_api/test_routes/test_airlock.py b/api_app/tests_ma/test_api/test_routes/test_airlock.py index 7d8f29576..842aec038 100644 --- a/api_app/tests_ma/test_api/test_routes/test_airlock.py +++ b/api_app/tests_ma/test_api/test_routes/test_airlock.py @@ -1,6 +1,5 @@ import time import pytest -import pytest_asyncio from mock import patch from fastapi import status from azure.core.exceptions import HttpResponseError @@ -129,7 +128,7 @@ def inner(): class TestAirlockRoutesThatRequireOwnerOrResearcherRights(): - @pytest_asyncio.fixture(autouse=True, scope='class') + @pytest.fixture(autouse=True, scope='class') def log_in_with_researcher_user(self, app, researcher_user): app.dependency_overrides[require_workspace_owner_or_researcher] = researcher_user app.dependency_overrides[require_workspace_owner_or_researcher_or_airlock_manager] = researcher_user @@ -305,7 +304,7 @@ async def test_get_airlock_container_link_returned_as_expected(self, get_airlock class TestAirlockRoutesThatRequireAirlockManagerRights(): - @pytest_asyncio.fixture(autouse=True, scope='class') + @pytest.fixture(autouse=True, scope='class') def log_in_with_airlock_manager_user(self, app, airlock_manager_user): app.dependency_overrides[require_airlock_manager] = airlock_manager_user app.dependency_overrides[require_workspace_owner_or_researcher_or_airlock_manager] = airlock_manager_user @@ -465,7 +464,7 @@ async def test_post_revoke_airlock_request_missing_reason_returns_422(self, _, a class TestAirlockRoutesPermissions(): - @pytest_asyncio.fixture() + @pytest.fixture() def log_in_with_user(self, app): def inner(user): app.dependency_overrides[require_workspace_owner_or_researcher] = user diff --git a/pyproject.toml b/pyproject.toml index 73f230679..c69eeaa6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,3 +3,7 @@ skip = "*.json,*.js,*.ts,*.tsx,*.map,package-lock.json,node_modules,.venv,.git,.yaspeller*,**/*devcontainer*,.gitignore,.gitattributes,LICENSE,Makefile,**/.dockerignore,**/Dockerfile,**/*.tf*,**/*.terraform*,**/requirements.txt,**/*.py,**/*.yml,**/*.yaml,**/*.sh,**/.env.tmpl,**/requirements-dev.txt" # Words to ignore ignore-words-list = "tre,aci,requestor,api,AspNet,az,AzureTRE,Codespaces,Conda,dataset,datasets,dev,Dev,DevOps,DotNet,exfiltration,Endpoints,GitHub,lifecycle,maintainer,maintainers,PowerShell,PyPi,QuickStart,quickstart,repo,repos,screenshots,terraform,Terraform,tfvars,tmpl,TREs,Xamarin,devcontainer,DevContainer,endpoints,pytest,tre,VNet,resourceType,isCurrent,msfttreacr,azurecr,io,azuretre,cnab,aci,westeurope,idempotent,Versioning,mixins,yml,microsoft,pre-emptively " + +[tool.pytest.ini_options] +asyncio_mode = "strict" +asyncio_default_fixture_loop_scope = "function"