chore: add test infrastructure with conftest for import paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 14:14:08 +01:00
parent be6d8bcef7
commit aefb129e07
3 changed files with 11 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
[pytest]
testpaths = tests
View File
+9
View File
@@ -0,0 +1,9 @@
"""Test configuration — adds package root to sys.path so bare imports work."""
import sys
from pathlib import Path
# Add the package root so `from stats_db import StatsDB` works in tests
# without requiring the full package to be installed.
_PACKAGE_ROOT = Path(__file__).resolve().parent.parent
if str(_PACKAGE_ROOT) not in sys.path:
sys.path.insert(0, str(_PACKAGE_ROOT))