refactor: consolidate conftest into src/tests/conftest.py

Remove the redundant src/conftest.py sys.path bootstrap and move it
into src/tests/conftest.py; run_tests.py already sets PYTHONPATH and
the tests package layout puts src/ on sys.path. Verified via
run_tests.py (619/619), direct pytest without PYTHONPATH, and
run_sanity.py (all checks green).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
nvaldez
2026-09-27 20:55:20 +02:00
parent d47a8b404a
commit f2c774429c
3 changed files with 11 additions and 7 deletions
-6
View File
@@ -1,6 +0,0 @@
# conftest.py - Pytest configuration
import os
import sys
# Add the current directory to the Python path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+4
View File
@@ -1,8 +1,12 @@
"""Pytest fixtures for librarian and mdoctor tests."""
import os
import sys
import tempfile
# Add the src directory to the Python path so the tool packages resolve
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import pytest
from librarian.librarian import Librarian
+7 -1
View File
@@ -61,7 +61,13 @@ block a correct install or make the docs contradict the code.
`pyproject.toml` comments or SPEC
- [ ] Remove `src/llm-wiki/utils/scripts/example.py` — `wiki init`
skips `.py` files, so it can never reach user wikis
- [ ] Deduplicate conftest: `src/conftest.py` vs `src/tests/conftest.py`
- [x] Deduplicate conftest: `src/conftest.py` vs `src/tests/conftest.py`
- [x] Consolidated into `src/tests/conftest.py` (sys.path bootstrap
moved there, outer file removed, 2026-09-27); verified
`python src/run_tests.py` (619/619), `python -m pytest` without
PYTHONPATH, and `python src/run_sanity.py` all pass — the
`6055ac6` revert was a misdiagnosis: the then-failing sanity was
the terminal-width issue below, not the conftest change
- [x] `run_sanity.py` run fails, need fixing
- [x] run sanity should show what exactly to fix
- [x] pytests should show which test are failing,