add resume

This commit is contained in:
ivankirpichnikov
2025-11-22 02:17:18 +03:00
parent a207e5a217
commit d9a3c39980
33 changed files with 1157 additions and 97 deletions
+16 -4
View File
@@ -1,23 +1,35 @@
from collections.abc import AsyncIterable
import asyncio
import os
from collections.abc import AsyncIterable, AsyncIterator
from pathlib import Path
from typing import Any
import pytest
from dishka import AsyncContainer
from template_project.web_api.configuration import load_configuration
from template_project.web_api.entry_point import make_server
from tests.web_api.helpers import get_unique_email
from tests.web_api.ioc import make_ioc
@pytest.fixture
async def dishka_container() -> AsyncIterable[AsyncContainer]:
path = Path("config.toml")
@pytest.fixture(scope="session")
async def dishka_container(backend: Any) -> AsyncIterable[AsyncContainer]:
path = Path(os.environ["CONFIGURATION_PATH"])
configuration = load_configuration(path)
ioc = make_ioc(configuration)
yield ioc
await ioc.close()
@pytest.fixture(scope="session")
async def backend() -> AsyncIterator[None]:
configuration = load_configuration(Path(os.environ["CONFIGURATION_PATH"]))
server = make_server(configuration)
asyncio.create_task(server.serve()) # type: ignore[unused-awaitable]
yield
@pytest.fixture
def unique_email() -> str:
return get_unique_email()