mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 23:37:18 +00:00
move configuration to root conftest
This commit is contained in:
parent
0f3741d5f4
commit
7897e9afd8
@ -3,6 +3,7 @@ import pytest
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Type, TypeVar
|
from typing import Any, Type, TypeVar
|
||||||
|
|
||||||
|
from ahriman.core.configuration import Configuration
|
||||||
from ahriman.models.package import Package
|
from ahriman.models.package import Package
|
||||||
from ahriman.models.package_desciption import PackageDescription
|
from ahriman.models.package_desciption import PackageDescription
|
||||||
from ahriman.models.repository_paths import RepositoryPaths
|
from ahriman.models.repository_paths import RepositoryPaths
|
||||||
@ -21,6 +22,12 @@ def anyvar(cls: Type[T], strict: bool = False) -> T:
|
|||||||
|
|
||||||
|
|
||||||
# generic fixtures
|
# 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
|
@pytest.fixture
|
||||||
def package_ahriman(package_description_ahriman: PackageDescription) -> Package:
|
def package_ahriman(package_description_ahriman: PackageDescription) -> Package:
|
||||||
packages = {"ahriman": package_description_ahriman}
|
packages = {"ahriman": package_description_ahriman}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from ahriman.core.alpm.pacman import Pacman
|
from ahriman.core.alpm.pacman import Pacman
|
||||||
from ahriman.core.alpm.repo import Repo
|
from ahriman.core.alpm.repo import Repo
|
||||||
from ahriman.core.build_tools.task import Task
|
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
|
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
|
@pytest.fixture
|
||||||
def leaf_ahriman(package_ahriman: Package) -> Leaf:
|
def leaf_ahriman(package_ahriman: Package) -> Leaf:
|
||||||
return Leaf(package_ahriman, set())
|
return Leaf(package_ahriman, set())
|
||||||
|
Loading…
Reference in New Issue
Block a user