- tests/conftest.py redirects MYTOOLKIT_HOME to a temp dir before imports so the module-level Config singleton never touches the real ~/.mytoolkit - CLI smoke: every registered command answers --help with exit code 0 - unit tests: Config get/set/migrate, templates_registry override/fallback, md_to_pdf pure helpers (pandoc-dependent cases skipif-guarded) - pyproject: dev dependency group (pytest) + pytest config; Makefile: make test
12 lines
359 B
Python
12 lines
359 B
Python
"""Pytest bootstrap: isolate tests from the real ~/.mytoolkit.
|
|
|
|
config.py and templates_registry.py resolve MYTOOLKIT_HOME at import time
|
|
and instantiate a module-level singleton, so the env var must be set before
|
|
any mytoolkit module is imported.
|
|
"""
|
|
|
|
import os
|
|
import tempfile
|
|
|
|
os.environ["MYTOOLKIT_HOME"] = tempfile.mkdtemp(prefix="mytoolkit-test-home-")
|