From 2598b0fd195189b45ca5221c3ec5584cd12e8f38 Mon Sep 17 00:00:00 2001 From: Dusk Banks Date: Tue, 22 Feb 2022 14:28:23 -0800 Subject: [PATCH] tests: pytest-asyncio `asyncio_mode` -> `strict` the `asyncio_mode` of `legacy` (current default) is deprecated. `asyncio_mode` will be `strict` by default in the future. --- pyproject.toml | 1 + tests/conftest.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa7f987..f3aa8ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,3 +4,4 @@ build-backend = "setuptools.build_meta" [tool.pytest.ini_options] # addopts = -n auto +asyncio_mode = "strict" diff --git a/tests/conftest.py b/tests/conftest.py index 17a5b6d..e89778b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,6 +8,7 @@ from pathlib import Path import tomli import pytest +import pytest_asyncio from nvchecker import core from nvchecker import __main__ as main @@ -41,7 +42,7 @@ async def run( vers, _has_failures = await main.run(result_coro, runner_coro) return vers -@pytest.fixture(scope="module") +@pytest_asyncio.fixture(scope="module") async def get_version(): async def __call__(name, config): entries = {name: config} @@ -50,7 +51,7 @@ async def get_version(): return __call__ -@pytest.fixture(scope="module") +@pytest_asyncio.fixture(scope="module") async def run_str(): async def __call__(str): entries = tomli.loads(str) @@ -59,7 +60,7 @@ async def run_str(): return __call__ -@pytest.fixture(scope="module") +@pytest_asyncio.fixture(scope="module") async def run_str_multi(): async def __call__(str): entries = tomli.loads(str)