You've already forked RekomenciBackend
add resume
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user