Skip to content

Commit

Permalink
Add pytest-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Sep 24, 2023
1 parent b94f762 commit 2b95800
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ jobs:
- name: Add test dependencies
run: mamba env update --file ci/environment-test.yml

- name: Reconfigure pytest-timeout
shell: bash -l {0}
# No SIGALRM available on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: sed -i.bak 's/timeout_method = signal/timeout_method = thread/' setup.cfg

- name: Dump environment
run: |
# For debugging
Expand Down
1 change: 1 addition & 0 deletions ci/environment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- jinja2
- packaging
- pytest
- pytest-timeout
- pytest-xdist
- pyyaml
- alembic
Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ profile = black
addopts = -v -rsxfE --durations=0 --color=yes --strict-markers --strict-config
markers =
stability: marks stability tests
# pytest-timeout settings
# 'thread' kills off the whole test suite. 'signal' only kills the offending test.
# However, 'signal' doesn't work on Windows (due to lack of SIGALRM).
# The 'tests' CI script modifies this config file on the fly for Windows clients.
timeout_method = signal
timeout = 1200

0 comments on commit 2b95800

Please sign in to comment.