From ac06ef62fc0b911ae7d1434ef0def9a74f7d1581 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sat, 16 Jul 2022 22:30:31 +0300 Subject: [PATCH] fixed tests --- testenv/tests/plugins/auth/test_http.py | 3 ++- testenv/tests/plugins/auth/test_pam.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/testenv/tests/plugins/auth/test_http.py b/testenv/tests/plugins/auth/test_http.py index 88718cf0..7a13f9b7 100644 --- a/testenv/tests/plugins/auth/test_http.py +++ b/testenv/tests/plugins/auth/test_http.py @@ -27,6 +27,7 @@ import aiohttp.web import aiohttp_basicauth import pytest +import pytest_asyncio from . import get_configured_auth_service @@ -41,7 +42,7 @@ async def _handle_auth(request: aiohttp.web.BaseRequest) -> aiohttp.web.Response return aiohttp.web.Response(text=str(status), status=status) -@pytest.fixture(name="auth_server_port") +@pytest_asyncio.fixture(name="auth_server_port") async def _auth_server_port_fixture(aiohttp_server) -> AsyncGenerator[int, None]: # type: ignore auth = aiohttp_basicauth.BasicAuthMiddleware( username="server-admin", diff --git a/testenv/tests/plugins/auth/test_pam.py b/testenv/tests/plugins/auth/test_pam.py index 84dcdff0..ea524cb4 100644 --- a/testenv/tests/plugins/auth/test_pam.py +++ b/testenv/tests/plugins/auth/test_pam.py @@ -29,6 +29,7 @@ from typing import AsyncGenerator from typing import Optional import pytest +import pytest_asyncio from . import get_configured_auth_service @@ -50,7 +51,7 @@ async def _run_process(cmd: str, input: Optional[str]=None) -> None: # pylint: assert proc.returncode == 0 -@pytest.fixture(name="test_user") +@pytest_asyncio.fixture(name="test_user") async def _test_user() -> AsyncGenerator[None, None]: with pytest.raises(KeyError): pwd.getpwnam(_USER)