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:
@@ -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 = ["."]
|
||||
|
||||
Reference in New Issue
Block a user