Skip to content

Commit eeb26bd

Browse files
committed
Avoid the warnings with a test class hack
1 parent 82e8f79 commit eeb26bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_bigger_data.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ def test_native_emac_model_fails(test_data_path):
157157
active = Active(ncfile, "aps_ave")
158158
active._version = 0
159159
d = active[4:5, 1:2]
160-
mean_result = np.mean(d)
160+
if len(d):
161+
mean_result = np.mean(d)
162+
else:
163+
# as it happens it is is possible for a slice to be
164+
# all missing, so for the purpose of this test we
165+
# ignore it, but the general case should not.
166+
pass
161167

162168
active = Active(ncfile, "aps_ave")
163169
active._version = 2

0 commit comments

Comments
 (0)