diff --git a/pyproject.toml b/pyproject.toml index 91a2c7698d..c0126861cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,7 @@ dev = [ "pytest-cov", "pytest-asyncio", "pytest-httpx>=0.35.0", + "pytest-timeout", "responses", "ruff", "semver", @@ -72,7 +73,7 @@ dev = [ "jwcrypto", "deepdiff", "tiled[minimal-server]>=0.2.4", # For system-test of dls.py - "respx" + "respx", ] [project.scripts] @@ -103,6 +104,7 @@ filterwarnings = ["error", "ignore::DeprecationWarning"] # Doctest python code in docs, python code in src docstrings, test functions in tests testpaths = "docs src tests" asyncio_mode = "auto" +timeout = 3 [tool.coverage.run] patch = ["subprocess"] @@ -178,6 +180,7 @@ commands = [ "term", "--cov-report", "xml:cov.xml", + "--timeout=60", { replace = "posargs", default = [ ], extend = true }, ], diff --git a/tests/unit_tests/test_example_config.py b/tests/unit_tests/test_example_config.py index f323cbcb31..5c6c6c742a 100644 --- a/tests/unit_tests/test_example_config.py +++ b/tests/unit_tests/test_example_config.py @@ -21,6 +21,7 @@ def test_example_config_is_valid(file_name: str): loader.load() +@pytest.mark.timeout(30) @pytest.mark.parametrize("file_name", os.listdir(example_helm)) def test_example_helm_is_valid(file_name: str): path = example_helm / file_name diff --git a/uv.lock b/uv.lock index 78f1c8f8c5..7acd1cd062 100644 --- a/uv.lock +++ b/uv.lock @@ -460,6 +460,7 @@ dev = [ { name = "pytest-asyncio" }, { name = "pytest-cov" }, { name = "pytest-httpx" }, + { name = "pytest-timeout" }, { name = "responses" }, { name = "respx" }, { name = "ruff" }, @@ -520,6 +521,7 @@ dev = [ { name = "pytest-asyncio" }, { name = "pytest-cov" }, { name = "pytest-httpx", specifier = ">=0.35.0" }, + { name = "pytest-timeout" }, { name = "responses" }, { name = "respx" }, { name = "ruff" }, @@ -4360,6 +4362,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/1e/55/1fa65f8e4fceb19dd6daa867c162ad845d547f6058cd92b4b02384a44777/pytest_httpx-0.36.2-py3-none-any.whl", hash = "sha256:d42ebd5679442dc7bfb0c48e0767b6562e9bc4534d805127b0084171886a5e22", size = 20315, upload-time = "2026-04-09T13:57:18.587Z" }, ] +[[package]] +name = "pytest-timeout" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ac/82/4c9ecabab13363e72d880f2fb504c5f750433b2b6f16e99f4ec21ada284c/pytest_timeout-2.4.0.tar.gz", hash = "sha256:7e68e90b01f9eff71332b25001f85c75495fc4e3a836701876183c4bcfd0540a", size = 17973, upload-time = "2025-05-05T19:44:34.99Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fa/b6/3127540ecdf1464a00e5a01ee60a1b09175f6913f0644ac748494d9c4b21/pytest_timeout-2.4.0-py3-none-any.whl", hash = "sha256:c42667e5cdadb151aeb5b26d114aff6bdf5a907f176a007a30b940d3d865b5c2", size = 14382, upload-time = "2025-05-05T19:44:33.502Z" }, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0"