test(backend): rend la configuration de test independante du poste

APP_ENV, APP_DEBUG, APP_LOG_LEVEL et APP_CORS_ORIGINS n'etaient poses nulle
part : le .env du developpeur les decidait, alors que les tests assertent en
dur l'environnement et que create_app coupe /openapi.json hors developpement.
Un poste portant APP_ENV=prod faisait tomber deux tests.

Fixe aussi asyncio_default_fixture_loop_scope, que pytest-asyncio 1.4 reclame.
This commit is contained in:
Johan LEROY
2026-09-15 09:57:46 +02:00
parent 552391c9bd
commit 98ec01c847
2 changed files with 12 additions and 1 deletions
+1
View File
@@ -79,6 +79,7 @@ disallow_untyped_defs = false
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = "-q --strict-markers -m 'not integration' --cov=app --cov-report=term-missing"
markers = ["integration: requiert une base PostgreSQL joignable, hors `make test`"]