From 0c56711032b893e36f0df6dbac067222b48aa9cd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 22 Dec 2023 19:06:02 +0100 Subject: [PATCH] use OS-independent separators fix tests on Windows --- python/tests/test_Result.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index d6bbd63a8..c7e4187ab 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -63,7 +63,7 @@ def h5py_dataset_iterator(): """Iterate over all datasets in an HDF5 file.""" def _h5py_dataset_iterator(g, prefix=''): for key,item in g.items(): - path = os.path.join(prefix, key) + path = '/'.join([prefix, key]) if isinstance(item, h5py.Dataset): # test for dataset yield (path, item) elif isinstance(item, h5py.Group): # test for group (go down) @@ -472,7 +472,7 @@ class TestResult: c = [_.decode() for _ in cur[path]] r = ['Unknown Phase Type'] + result.phases assert c == r - grp = os.path.split(path)[0] + grp = str(path).rpartition('/')[0] for attr in ref[grp].attrs: assert np.array_equal(ref[grp].attrs[attr],cur[grp].attrs[attr]) for attr in dset.attrs: