From bd9dca40c19cf9fed52b315d577db3380c111df1 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Fri, 27 Aug 2021 09:09:35 -0500 Subject: [PATCH] [Unittest] Skip some tests if h5py is not installed --- interfaces/cython/cantera/test/test_composite.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfaces/cython/cantera/test/test_composite.py b/interfaces/cython/cantera/test/test_composite.py index 721c20cbf8c..c8f839aa277 100644 --- a/interfaces/cython/cantera/test/test_composite.py +++ b/interfaces/cython/cantera/test/test_composite.py @@ -154,6 +154,7 @@ def test_append_no_norm_data(self): self.assertEqual(states[0].P, gas.P) self.assertArrayNear(states[0].Y, gas.Y) + @utilities.unittest.skipIf(isinstance(_h5py, ImportError), "h5py is not installed") def test_import_no_norm_data(self): outfile = self.test_work_path / "solutionarray.h5" # In Python >= 3.8, this can be replaced by the missing_ok argument @@ -469,6 +470,7 @@ def check(a, b): b.restore_data(data) check(a, b) + @utilities.unittest.skipIf(isinstance(_h5py, ImportError), "h5py is not installed") def test_import_no_norm_water(self): outfile = self.test_work_path / "solutionarray.h5" # In Python >= 3.8, this can be replaced by the missing_ok argument