Skip to content

Commit b50ea55

Browse files
committed
Skip some job manager tests on python 3.7
no support for `shift` on `time_machine` fixture below python 3.8 refs #590, #596, #578
1 parent 03a8cc6 commit b50ea55

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"matplotlib",
2929
"geopandas",
3030
"flake8>=5.0.0",
31-
"time_machine>=2.13.0",
31+
"time_machine",
3232
"pyproj>=3.2.0", # Pyproj is an optional, best-effort runtime dependency
3333
"dirty_equals>=0.6.0",
3434
# (#578) On Python 3.7: avoid dirty_equals 0.7.1 which wrongly claims to be Python 3.7 compatible

tests/extra/test_job_management.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import datetime
22
import json
33
import re
4+
import sys
45
import textwrap
56
import threading
67
import time
@@ -509,6 +510,11 @@ def test_automatic_cancel_of_too_long_running_jobs(
509510
cancel_after_seconds,
510511
expected_status,
511512
):
513+
if not hasattr(time_machine, "shift"):
514+
# TODO #578 remove this hack to skip this test on Python 3.7
515+
# `time_machine.shift` is only available since timemachine>=2.13.0, which only support Python 3.8 and up
516+
pytest.skip("time_machine.shift not available")
517+
512518
fake_backend = FakeBackend(requests_mock=requests_mock)
513519

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

0 commit comments

Comments
 (0)