test(ci): scope pytest timeout to test bodies, not fixture setup

Why:
- Testcontainers' session-scoped container startup (~25s on a cold Docker
  cache) was charged against the global 10s pytest-timeout budget, causing
  every integration test to fail regardless of its own runtime.

Changes:
- Set timeout_func_only = true so the budget applies to the test function
  only, not fixture setup.
This commit is contained in:
Ali Zarinkolah
2026-08-20 18:14:45 +03:30
parent 9a4b173b95
commit e8fb41af87

View File

@@ -37,6 +37,11 @@ dev = [
testpaths = ["tests"] testpaths = ["tests"]
asyncio_mode = "strict" asyncio_mode = "strict"
timeout = 10 timeout = 10
# Bound the test function only, not fixture setup. Testcontainers' container
# startup is charged to whichever test first pulls a session-scoped container
# fixture; on a cold Docker cache that is ~25s and would trip the 10s budget
# for every integration test, regardless of how fast the test itself is.
timeout_func_only = true
markers = [ markers = [
"unit: fast tests with no external services", "unit: fast tests with no external services",
"integration: tests against a real disposable service", "integration: tests against a real disposable service",