danish-dynaword / tests /conftest.py
KennethEnevoldsen's picture
update descriptive stats
f2ad4e1 unverified
raw
history blame
408 Bytes
from pathlib import Path
from typing import Any
import pytest
import yaml
@pytest.fixture()
def repo_path() -> Path:
return Path(__file__).parent.parent
def readme_yaml_header(repo_path: Path) -> dict[str, Any]:
readme_path = repo_path / "README.md"
with readme_path.open("r") as f:
readme = f.read()
frontmatter = readme.split("---")[1]
return yaml.safe_load(frontmatter)