From a0d806f3169f1fd06cfaf59e03ce7b22bf9b90d2 Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Sun, 29 Dec 2024 16:33:04 +0100 Subject: [PATCH] Fix test further --- test/test_external.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test_external.py b/test/test_external.py index f74454a..6597b27 100644 --- a/test/test_external.py +++ b/test/test_external.py @@ -9,6 +9,13 @@ INP_PATH = os.path.join(os.path.split(__file__)[0], "../data/example.tif") EXP_PATH = os.path.join(os.path.split(__file__)[0], "../data/example.h5") +CAN_READ_EXP = True +try: + with h5py.File(EXP_PATH, "r") as f: + f["t00000/s00/0/cells"][:] +except Exception: + CAN_READ_EXP = False + # Dummy test data, needs to be converted to bdv/xml with FIJI externally. def make_test_data(): @@ -34,7 +41,7 @@ def tearDown(self): except OSError: pass - @unittest.skipUnless(os.path.exists(INP_PATH), "Needs pre-computed test data") + @unittest.skipUnless(CAN_READ_EXP, "Needs pre-computed test data.") def test_external(self): from pybdv import make_bdv