Skip to content

Commit

Permalink
Timeout the tests instead of just hanging indefinitely
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch committed Jan 16, 2024
1 parent de334db commit d891eed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ python_files=test_*.py
python_classes=Test*
python_functions = test_*
junit_family=xunit2
# Only the tests should count towards timeouts
timeout_func_only = true
7 changes: 7 additions & 0 deletions tests/pytests/unit/utils/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
from tests.support.helpers import patched_environ
from tests.support.mock import MagicMock, patch

pytestmark = [
# Skip testing on windows since it does not support signals
# which is what the timeout marker is using.
pytest.mark.skip_on_windows,
pytest.mark.timeout(60, method="signal"),
]


@pytest.fixture(autouse=True)
def _cleanup():
Expand Down

0 comments on commit d891eed

Please sign in to comment.