Skip to content

Commit 78dd2ae

Browse files
authored
skipping long tests (#132)
1 parent eee24e4 commit 78dd2ae

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

tests/create/test_create.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import hashlib
1212
import json
1313
import os
14-
import sys
1514
from functools import wraps
1615
from unittest.mock import patch
1716

@@ -38,24 +37,6 @@
3837
assert NAMES, "No yaml files found in " + HERE
3938

4039

41-
def is_ubuntu():
42-
if os.path.isfile("/etc/os-release"):
43-
with open("/etc/os-release") as f:
44-
return "Ubuntu" in f.read()
45-
return False
46-
47-
48-
def is_darwin():
49-
if os.path.isfile("/etc/os-release"):
50-
with open("/etc/os-release") as f:
51-
return "Darwin" in f.read()
52-
return False
53-
54-
55-
# run extensive tests only on Ubuntu and Darwin, and not on Python 3.9 and 3.11
56-
extensive_tests = (sys.version_info[:2] not in [(3, 9), (3, 11)]) and (is_ubuntu() or is_darwin())
57-
58-
5940
def mockup_from_source(func):
6041
@wraps(func)
6142
def wrapper(*args, **kwargs):
@@ -251,8 +232,10 @@ def compare(self):
251232
# do not compare tendencies statistics yet, as we don't know yet if they should stay
252233

253234

235+
# it would be nice to use a @pytest.mark.slow and configure this globally
236+
# this could be done when refactoring the tests, and setting up canary/nightly builds
237+
@pytest.mark.skipif(not os.environ.get("SLOW_TESTS"), reason="No SLOW_TESTS env var")
254238
@pytest.mark.parametrize("name", NAMES)
255-
@pytest.mark.skipif(not extensive_tests, reason="Skipping to run the test faster")
256239
@mockup_from_source
257240
def test_run(name):
258241
config = os.path.join(HERE, name + ".yaml")

tests/xarray/test_samples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
URL = "https://object-store.os-api.cci1.ecmwf.int/ml-tests/test-data/samples/"
1919

2020
SAMPLES = list(range(23))
21-
SKIP = [0, 1, 2, 3, 4]
21+
SKIP = [0, 1, 2, 3, 4, 22]
2222

2323

2424
def _test_samples(n, check_skip=True):

0 commit comments

Comments
 (0)