From e8fb41af87b5c6e9b06c85eedb36c4f83e90d1ac Mon Sep 17 00:00:00 2001 From: Ali Zarinkolah Date: Thu, 20 Aug 2026 18:14:45 +0330 Subject: [PATCH] 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. --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 9b08ce7..06fe080 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,11 @@ dev = [ testpaths = ["tests"] asyncio_mode = "strict" 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 = [ "unit: fast tests with no external services", "integration: tests against a real disposable service",