You've already forked RekomenciBackend
add edit resume
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
from collections.abc import AsyncIterable, AsyncIterator
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from typing import cast
|
||||
|
||||
import pytest
|
||||
from dishka import AsyncContainer
|
||||
from fastapi import FastAPI
|
||||
|
||||
from template_project.web_api.configuration import load_configuration
|
||||
from template_project.web_api.entry_point import make_server
|
||||
@@ -14,20 +16,23 @@ from tests.web_api.ioc import make_ioc
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
async def dishka_container(backend: Any) -> AsyncIterable[AsyncContainer]:
|
||||
async def dishka_container(backend: FastAPI) -> AsyncIterable[AsyncContainer]:
|
||||
path = Path(os.environ["CONFIGURATION_PATH"])
|
||||
configuration = load_configuration(path)
|
||||
ioc = make_ioc(configuration)
|
||||
ioc = make_ioc(configuration, backend)
|
||||
yield ioc
|
||||
await ioc.close()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
async def backend() -> AsyncIterator[None]:
|
||||
async def backend() -> AsyncIterator[FastAPI]:
|
||||
logging.getLogger("httpx").setLevel(logging.WARNING)
|
||||
logging.getLogger("httpcore").setLevel(logging.WARNING)
|
||||
|
||||
configuration = load_configuration(Path(os.environ["CONFIGURATION_PATH"]))
|
||||
server = make_server(configuration)
|
||||
asyncio.create_task(server.serve()) # type: ignore[unused-awaitable]
|
||||
yield
|
||||
yield cast(FastAPI, server.config.app)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user