diff --git a/backend/tests/integration/conftest.py b/backend/tests/integration/conftest.py index 57978efa04..f40e71bf3d 100644 --- a/backend/tests/integration/conftest.py +++ b/backend/tests/integration/conftest.py @@ -1,7 +1,7 @@ import asyncio import os from pathlib import Path -from typing import Any +from typing import Any, Generator import pytest import yaml @@ -24,12 +24,12 @@ @pytest.fixture(scope="session", autouse=True) -def add_tracker(): +def add_tracker() -> None: os.environ["PYTEST_RUNNING"] = "true" @pytest.fixture(scope="session") -def event_loop(): +def event_loop() -> Generator: """Overrides pytest default function scoped event loop""" policy = asyncio.get_event_loop_policy() loop = policy.new_event_loop() @@ -37,7 +37,7 @@ def event_loop(): loop.close() -async def load_infrastructure_schema(db: InfrahubDatabase): +async def load_infrastructure_schema(db: InfrahubDatabase) -> None: base_dir = get_models_dir() / "base" default_branch_name = registry.default_branch @@ -57,7 +57,7 @@ async def load_infrastructure_schema(db: InfrahubDatabase): @pytest.fixture(scope="module") -async def init_db_infra(db: InfrahubDatabase): +async def init_db_infra(db: InfrahubDatabase) -> None: await delete_all_nodes(db=db) await first_time_initialization(db=db) await load_infrastructure_schema(db=db) @@ -65,7 +65,7 @@ async def init_db_infra(db: InfrahubDatabase): @pytest.fixture(scope="module") -async def init_db_base(db: InfrahubDatabase): +async def init_db_base(db: InfrahubDatabase) -> None: await delete_all_nodes(db=db) await first_time_initialization(db=db) await initialization(db=db) @@ -126,12 +126,12 @@ def git_repo_car_dealership(git_sources_dir: Path) -> FileRepo: @pytest.fixture(scope="session", autouse=True) -def prefect_test_fixture(): +def prefect_test_fixture() -> Generator: with prefect_test_harness(server_startup_timeout=60): yield @pytest.fixture(scope="session") -def prefect_test(prefect_test_fixture): +def prefect_test(prefect_test_fixture) -> Generator: with disable_run_logger(): yield