Skip to content

Commit e5430fd

Browse files
committed
fix test with correct loaders and imports
1 parent aa1a481 commit e5430fd

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

tests/test_missing.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77
import tempfile
88
import unittest
99

10+
# TODO remove in stable
11+
import h5py
12+
import h5netcdf
13+
1014
import pyfive
1115

1216
from netCDF4 import Dataset
1317

14-
from activestorage.active import Active
18+
from activestorage.active import Active, load_from_s3
1519
from activestorage.config import *
1620
from activestorage import dummy_data as dd
1721

@@ -194,17 +198,24 @@ def test_validmax(tmp_path):
194198
assert unmasked_numpy_mean != masked_numpy_mean
195199
print("Numpy masked result (mean)", masked_numpy_mean)
196200

201+
# load files via external protocols
202+
y = Dataset(testfile)
203+
z = h5py.File(testfile)
204+
a = h5netcdf.File(testfile)
205+
197206
# write file to storage
198207
testfile = utils.write_to_storage(testfile)
199-
x = pyfive.File(testfile)
200-
y = Dataset(testfile)
208+
209+
# load file via our protocols
210+
if USE_S3:
211+
x = load_from_s3(testfile)
212+
else:
213+
x = pyfive.File(testfile)
214+
215+
# print for Bryan
201216
print('bnl',y['data'].getncattr('valid_max'))
202217
print('bnl',x['data'].attrs.get('valid_max'))
203-
import h5py
204-
z = h5py.File(testfile)
205218
print('bnl',z['data'].attrs.get('valid_max'))
206-
import h5netcdf
207-
a = h5netcdf.File(testfile)
208219
print('bnl',a['data'].attrs.get('valid_max'))
209220

210221

0 commit comments

Comments
 (0)