14
14
15
15
esmvaltool_sample_data = pytest .importorskip ("esmvaltool_sample_data" )
16
16
17
+ # Increase this number anytime you change the cached input data to the tests.
18
+ TEST_REVISION = 1
19
+
17
20
CALENDAR_PARAMS = (
18
21
pytest .param (
19
22
'360_day' ,
@@ -41,6 +44,7 @@ def assert_array_almost_equal(this, other):
41
44
42
45
def preprocess_data (cubes , time_slice : dict = None ):
43
46
"""Regrid the data to the first cube and optional time-slicing."""
47
+ # Increase TEST_REVISION anytime you make changes to this function.
44
48
if time_slice :
45
49
cubes = [extract_time (cube , ** time_slice ) for cube in cubes ]
46
50
@@ -61,14 +65,14 @@ def get_cache_key(value):
61
65
"""Get a cache key that is hopefully unique enough for unpickling.
62
66
63
67
If this doesn't avoid problems with unpickling the cached data,
64
- manually clean the pytest cache with the command `pytest --cache-
65
- clear`.
68
+ manually clean the pytest cache with the command `pytest --cache-clear`.
66
69
"""
67
70
return ' ' .join ([
68
71
str (value ),
69
72
iris .__version__ ,
70
73
np .__version__ ,
71
74
sys .version ,
75
+ f"rev-{ TEST_REVISION } " ,
72
76
])
73
77
74
78
@@ -82,6 +86,7 @@ def timeseries_cubes_month(request):
82
86
if data :
83
87
cubes = pickle .loads (data .encode ('latin1' ))
84
88
else :
89
+ # Increase TEST_REVISION anytime you make changes here.
85
90
time_slice = {
86
91
'start_year' : 1985 ,
87
92
'end_year' : 1987 ,
@@ -111,6 +116,7 @@ def timeseries_cubes_day(request):
111
116
cubes = pickle .loads (data .encode ('latin1' ))
112
117
113
118
else :
119
+ # Increase TEST_REVISION anytime you make changes here.
114
120
time_slice = {
115
121
'start_year' : 2001 ,
116
122
'end_year' : 2002 ,
0 commit comments