Consolidate test site fixture into a single make_site

This commit is contained in:
2026-09-03 03:10:13 +02:00
parent 2835b77146
commit 1fe2bbd1db
4 changed files with 39 additions and 21 deletions
+15 -3
View File
@@ -1,8 +1,20 @@
import shutil
from pathlib import Path
import pytest
from omicron.ssg.site import Site
DATA_SITES = Path(__file__).parent.parent / "data" / "sites"
@pytest.fixture
def thin_site(tmp_path):
(tmp_path / "config.yml").write_text("name: test\ntemplate: plain\n")
return Site(tmp_path)
def make_site(tmp_path):
def _make(name, **kwargs):
site_dir = tmp_path / name
shutil.copytree(
DATA_SITES / name,
site_dir,
ignore=shutil.ignore_patterns("output", "build.log"),
)
return Site(site_dir, **kwargs)
return _make