Skip to content

Commit

Permalink
Skip some job manager tests on python 3.7
Browse files Browse the repository at this point in the history
no support for `shift` on `time_machine` fixture below python 3.8

refs #590, #596, #578
  • Loading branch information
soxofaan committed Sep 5, 2024
1 parent 03a8cc6 commit b50ea55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"matplotlib",
"geopandas",
"flake8>=5.0.0",
"time_machine>=2.13.0",
"time_machine",
"pyproj>=3.2.0", # Pyproj is an optional, best-effort runtime dependency
"dirty_equals>=0.6.0",
# (#578) On Python 3.7: avoid dirty_equals 0.7.1 which wrongly claims to be Python 3.7 compatible
Expand Down
6 changes: 6 additions & 0 deletions tests/extra/test_job_management.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import json
import re
import sys
import textwrap
import threading
import time
Expand Down Expand Up @@ -509,6 +510,11 @@ def test_automatic_cancel_of_too_long_running_jobs(
cancel_after_seconds,
expected_status,
):
if not hasattr(time_machine, "shift"):
# TODO #578 remove this hack to skip this test on Python 3.7
# `time_machine.shift` is only available since timemachine>=2.13.0, which only support Python 3.8 and up
pytest.skip("time_machine.shift not available")

fake_backend = FakeBackend(requests_mock=requests_mock)

# For simplicity, set up pre-existing job with status "running" (instead of job manager creating+starting it)
Expand Down

0 comments on commit b50ea55

Please sign in to comment.