use OS-independent separators

fix tests on Windows
This commit is contained in:
Martin Diehl 2023-12-22 19:06:02 +01:00
parent af5bbed003
commit 0c56711032
No known key found for this signature in database
GPG Key ID: 1FD50837275A0A9B
1 changed files with 2 additions and 2 deletions

View File

@ -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: