fastmcp/tests/client/tasks/conftest.py
Jeremiah Lowin 24d7aefe28
fix: shield lifespan teardown from cancellation (#3480)
* fix: shield lifespan teardown from cancellation

Co-authored-by: Claude <noreply@anthropic.com>

* fix: stabilize flaky task and timeout tests under parallel execution

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-13 19:47:42 -04:00

15 lines
542 B
Python

"""Configuration for client task tests.
Task tests require Docket infrastructure (Redis-backed task queue) which can
take significant time to initialize, especially under parallel test execution.
The default 5s timeout is too tight for these tests.
"""
import pytest
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
"""Increase timeout for task tests that need Docket infrastructure."""
for item in items:
if not item.get_closest_marker("timeout"):
item.add_marker(pytest.mark.timeout(15))