Skip to content

Commit e67c6ab

Browse files
committed
Don't fail the test if h5py is not available
1 parent 330019d commit e67c6ab

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/python/unittest/API/APITest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,6 +2242,11 @@ def testSeriesConstructors(self):
22422242
def testScalarHdf5Fields(self):
22432243
if "hdf5" not in io.variants:
22442244
return
2245+
try:
2246+
import h5py
2247+
except ImportError:
2248+
return
2249+
22452250
file = "../samples/scalar_hdf5.h5"
22462251
series_write = io.Series(file, io.Access.create)
22472252
E_x = series_write.write_iterations()[0].meshes["E"]["x"]
@@ -2250,7 +2255,6 @@ def testScalarHdf5Fields(self):
22502255
series_write.close()
22512256

22522257
# Now turn E_x into a scalar
2253-
import h5py
22542258
with h5py.File(file, "r+") as f:
22552259
E = f["data"]["0"]["meshes"]["E"]
22562260
reapply_attributes = \

0 commit comments

Comments
 (0)