[pytest] # Run from backend/ (the image's /app). `pythonpath = .` puts the app package on sys.path so tests # import it as `app.*`, matching runtime. Most of the suite is pure-logic; the DB-backed lane opts in # via the `db` fixture and runs in the compose test image. `-rs` reports skip REASONS so a silently # skipped lane is visible (and conftest makes a missing DB/ffmpeg a hard error unless # SIFTLODE_TEST_REQUIRE_DB=0). `--strict-markers`: a misspelt `@pytest.mark.skipiff` is an error, # not an unknown marker that quietly does nothing. testpaths = tests pythonpath = . # `-p tests.db_per_worker`: under pytest-xdist (`-n`) every worker gets its own database — DATABASE_URL + `_gw`, # created on first use — because the `db` fixture's TRUNCATE-per-test isolation assumes one process per database. # It is a plugin so it runs before conftest imports the app (whose settings read DATABASE_URL once). Serial: no-op. # The file is a verbatim copy of a shared tool (see its docstring); change the source, not the copy. addopts = -q -rs --strict-markers -p tests.db_per_worker db_per_worker_env = DATABASE_URL