Skip to content

Commit fb13488

Browse files
Add timeout to auth/aio tests
1 parent 9bf6a4e commit fb13488

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/auth/aio/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
Pytest configuration for async authentication tests.
3+
4+
This module applies a default timeout to all tests in the test/auth/aio/ directory
5+
to prevent tests from hanging indefinitely when waiting for external authentication
6+
services (Snowflake connections, browser interactions, MFA, OAuth flows, etc.).
7+
"""
8+
9+
from __future__ import annotations
10+
11+
import pytest
12+
13+
# Default timeout for all auth/aio tests (in seconds)
14+
# These tests involve external services and browser automation,
15+
# so they need sufficient time to complete but should not hang indefinitely.
16+
DEFAULT_AUTH_TEST_TIMEOUT = 60 # seper test
17+
18+
19+
def pytest_collection_modifyitems(items) -> None:
20+
"""Apply default timeout to all tests in this directory."""
21+
for item in items:
22+
# Only add timeout if not already set
23+
if not any(mark.name == "timeout" for mark in item.iter_markers()):
24+
item.add_marker(pytest.mark.timeout(DEFAULT_AUTH_TEST_TIMEOUT))

0 commit comments

Comments
 (0)