From 7897e9afd8a80c662db6c9af6c0e8b164ea60154 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Sun, 28 Mar 2021 03:30:59 +0300 Subject: [PATCH] move configuration to root conftest --- tests/ahriman/conftest.py | 7 +++++++ tests/ahriman/core/conftest.py | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/ahriman/conftest.py b/tests/ahriman/conftest.py index 6b6d23e6..87c1d768 100644 --- a/tests/ahriman/conftest.py +++ b/tests/ahriman/conftest.py @@ -3,6 +3,7 @@ import pytest from pathlib import Path from typing import Any, Type, TypeVar +from ahriman.core.configuration import Configuration from ahriman.models.package import Package from ahriman.models.package_desciption import PackageDescription from ahriman.models.repository_paths import RepositoryPaths @@ -21,6 +22,12 @@ def anyvar(cls: Type[T], strict: bool = False) -> T: # generic fixtures +@pytest.fixture +def configuration(resource_path_root: Path) -> Configuration: + path = resource_path_root / "core" / "ahriman.ini" + return Configuration.from_path(path=path, logfile=False) + + @pytest.fixture def package_ahriman(package_description_ahriman: PackageDescription) -> Package: packages = {"ahriman": package_description_ahriman} diff --git a/tests/ahriman/core/conftest.py b/tests/ahriman/core/conftest.py index 6ae80a27..a6f6fc4b 100644 --- a/tests/ahriman/core/conftest.py +++ b/tests/ahriman/core/conftest.py @@ -1,7 +1,5 @@ import pytest -from pathlib import Path - from ahriman.core.alpm.pacman import Pacman from ahriman.core.alpm.repo import Repo from ahriman.core.build_tools.task import Task @@ -11,12 +9,6 @@ from ahriman.models.package import Package from ahriman.models.repository_paths import RepositoryPaths -@pytest.fixture -def configuration(resource_path_root: Path) -> Configuration: - path = resource_path_root / "core" / "ahriman.ini" - return Configuration.from_path(path=path, logfile=False) - - @pytest.fixture def leaf_ahriman(package_ahriman: Package) -> Leaf: return Leaf(package_ahriman, set())