[pytest] # Test discovery testpaths = tests python_files = test_*.py python_classes = Test* python_functions = test_* # Asyncio mode asyncio_mode = auto # Fixtures et tests partagent la meme boucle (portee fonction, le defaut). # Forcer les fixtures en portee session les placait dans une boucle differente # de celle des tests : les connexions asyncpg creees par les fixtures y etaient # alors "attached to a different loop", ce qui remontait en HTTP 500 depuis les # routes. Le moteur de base est cree par test (conftest.pg_engine) ; seule la # migration Alembic, synchrone, reste faite une fois par session. asyncio_default_fixture_loop_scope = function # Timeout configuration timeout = 300 timeout_method = thread # Test markers markers = slow: marks tests as slow (deselect with '-m "not slow"') integration: marks tests as integration tests unit: marks tests as unit tests api: marks tests as API tests services: marks tests as service tests # Output options # La couverture n'est PAS dans addopts : elle rendait pytest-cov obligatoire # pour seulement lancer `pytest`. Pour un rapport de couverture : # pytest --cov=app --cov-report=term-missing --cov-branch addopts = --verbose --strict-markers --tb=short # Minimum coverage threshold (optional, uncomment to enforce) # --cov-fail-under=80 # Logging log_cli = false log_cli_level = INFO log_cli_format = %(asctime)s [%(levelname)8s] %(message)s log_cli_date_format = %Y-%m-%d %H:%M:%S # Warnings filterwarnings = error ignore::UserWarning ignore::DeprecationWarning # Coverage options [coverage:run] source = app omit = */tests/* */migrations/* */__pycache__/* */site-packages/* [coverage:report] precision = 2 show_missing = True skip_covered = False [coverage:html] directory = htmlcov