Skip to content

Commit cf3e2f1

Browse files
TEST: simplify conftest.py to only feature/29 scope
Remove MkDocs build fixtures (docs_dir, build_site) that belong to feature/28 (show_footer). Admonition tests only read CSS files directly and require no fixtures. Refs #29
1 parent eb56c2a commit cf3e2f1

1 file changed

Lines changed: 0 additions & 35 deletions

File tree

tests/conftest.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,5 @@
1-
import textwrap
2-
import pytest
31
from pathlib import Path
42

5-
63
THEME_DIR = Path(__file__).parent.parent / "mkdocs_dracula_theme"
74
CSS_SOURCE = Path(__file__).parent.parent / "template" / "assets" / "css" / "mkdocs.css"
85
CSS_MIN = THEME_DIR / "assets" / "css" / "mkdocs.min.css"
9-
10-
11-
@pytest.fixture()
12-
def docs_dir(tmp_path):
13-
d = tmp_path / "docs"
14-
d.mkdir()
15-
(d / "index.md").write_text("# Home\nHello world.\n")
16-
return d
17-
18-
19-
@pytest.fixture()
20-
def build_site(tmp_path, docs_dir):
21-
"""Factory: build a minimal MkDocs site and return the index.html content."""
22-
from mkdocs.config import load_config
23-
from mkdocs.commands.build import build
24-
25-
def _build(extra_theme_config: str = "") -> str:
26-
config_text = textwrap.dedent(f"""
27-
site_name: Test Site
28-
docs_dir: {docs_dir}
29-
site_dir: {tmp_path / "site"}
30-
theme:
31-
name: dracula
32-
{extra_theme_config}
33-
""")
34-
cfg_path = tmp_path / "mkdocs.yml"
35-
cfg_path.write_text(config_text)
36-
cfg = load_config(str(cfg_path))
37-
build(cfg)
38-
return (tmp_path / "site" / "index.html").read_text()
39-
40-
return _build

0 commit comments

Comments
 (0)