Skip to content

Commit

Permalink
tests: Add timeout to pytest (OSGeo#2499)
Browse files Browse the repository at this point in the history
Now the individual pytest tests are terminated after 300 seconds just like the gunittest ones. New dependency pytest-timeout is needed for testing to use the timeout (or avoid the warning about unused configuration). In the future, individual tests can change the time if needed using the pytest.mark.timeout decorator.
  • Loading branch information
wenzeslaus authored Jul 26, 2022
1 parent 383f928 commit 37d45fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r .github/workflows/python_requirements.txt
pip install -r .github/workflows/optional_requirements.txt
pip install pytest
pip install pytest pytest-timeout
- name: Create installation directory
run: |
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ addopts = """
--doctest-glob='*doctest*.txt'
--ignore='raster/r.category/test_rcategory_doctest.txt'
"""
timeout = 300

0 comments on commit 37d45fb

Please sign in to comment.