37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
"""Shared fixtures — temp vault + sample documents."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_docs(tmp_path: Path) -> Path:
|
|
"""Input directory with a couple of small markdown/txt documents."""
|
|
docs = tmp_path / "docs"
|
|
docs.mkdir()
|
|
(docs / "deep-learning-notes.md").write_text(
|
|
"# Deep Learning\n\n"
|
|
"Neural networks learn representations via gradient descent.\n\n"
|
|
"## Optimizers\n\n"
|
|
"SGD is simple. Adam adapts per-parameter learning rates.\n\n"
|
|
"## Regularization\n\n"
|
|
"Dropout randomly masks units during training to reduce overfit.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(docs / "reading-list.txt").write_text(
|
|
"Books to read this year, in no particular order.\n\n"
|
|
"The Pragmatic Programmer. Structure and Interpretation.\n",
|
|
encoding="utf-8",
|
|
)
|
|
return docs
|
|
|
|
|
|
@pytest.fixture
|
|
def vault(tmp_path: Path) -> Path:
|
|
vault_dir = tmp_path / "ObsidianVault"
|
|
vault_dir.mkdir()
|
|
return vault_dir
|