clan-core/pkgs/clan-cli/tests/root.py

36 lines
653 B
Python
Raw Normal View History

import os
2023-08-08 14:28:38 +00:00
from pathlib import Path
import pytest
TEST_ROOT = Path(__file__).parent.resolve()
2023-09-27 14:18:52 +00:00
PROJECT_ROOT = TEST_ROOT.parent
2023-09-27 14:13:04 +00:00
if CLAN_CORE_ := os.environ.get("CLAN_CORE"):
CLAN_CORE = Path(CLAN_CORE_)
else:
2023-09-27 14:18:52 +00:00
CLAN_CORE = PROJECT_ROOT.parent.parent
2023-08-08 14:28:38 +00:00
2023-08-09 14:38:08 +00:00
@pytest.fixture(scope="session")
2023-08-08 14:28:38 +00:00
def project_root() -> Path:
"""
2023-09-27 14:18:52 +00:00
Root directory the clan-cli
2023-08-08 14:28:38 +00:00
"""
return PROJECT_ROOT
2023-08-09 14:38:08 +00:00
@pytest.fixture(scope="session")
2023-08-08 14:28:38 +00:00
def test_root() -> Path:
"""
Root directory of the tests
"""
return TEST_ROOT
2023-09-15 14:34:16 +00:00
@pytest.fixture(scope="session")
def clan_core() -> Path:
"""
Directory of the clan-core flake
"""
return CLAN_CORE