fix(ci): la collecte des tests échouait sous le binaire pytest
CI / test (push) Successful in 1m38s

from tests.conftest import ... levait ModuleNotFoundError en CI :
le binaire pytest n'ajoute pas le répertoire courant à sys.path,
contrairement à python -m pytest (utilisé en local, qui masquait le
problème). Correctifs : tests/__init__.py (package), pythonpath=[.]
dans la config pytest, et étape CI en python -m pytest.
Vérifié : 36/36 dans les trois modes d'invocation.
This commit is contained in:
Spark
2026-10-11 09:41:15 -04:00
parent c7212e88ad
commit 2060ca949d
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -17,4 +17,4 @@ jobs:
- name: Compile check
run: python -m py_compile app/*.py
- name: Tests
run: pytest -q
run: python -m pytest -q
+4
View File
@@ -24,3 +24,7 @@ dev = [
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
# Always put the repo root on sys.path: the plain `pytest` binary (CI)
# does not add the CWD, unlike `python -m pytest` — without this,
# `from tests.conftest import ...` fails at collection time in CI.
pythonpath = ["."]
+8
View File
@@ -0,0 +1,8 @@
"""Kanbante test suite.
This package marker matters: with it, pytest puts the repository root on
sys.path, so `from tests.conftest import ...` resolves identically
whether the suite is launched via the `pytest` binary (CI) or via
`python -m pytest` (which additionally adds the CWD). The root is also
pinned explicitly through `pythonpath` in pyproject.toml.
"""