Skip to content

Commit 6bf8c89

Browse files
Assert equal pathlib.Path instead of str
1 parent 54ad859 commit 6bf8c89

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

nibabel/freesurfer/tests/test_mghformat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import io
1212
import os
13+
import pathlib
1314

1415
import numpy as np
1516
import pytest
@@ -291,7 +292,7 @@ def test_mgh_load_fileobj():
291292
# pass the filename to the array proxy, please feel free to change this
292293
# test.
293294
img = MGHImage.load(MGZ_FNAME)
294-
assert img.dataobj.file_like == MGZ_FNAME
295+
assert pathlib.Path(img.dataobj.file_like) == pathlib.Path(MGZ_FNAME)
295296
# Check fileobj also passed into dataobj
296297
with ImageOpener(MGZ_FNAME) as fobj:
297298
contents = fobj.read()

nibabel/tests/test_ecat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99

1010
import os
11+
import pathlib
1112
import warnings
1213
from unittest import TestCase
1314

@@ -183,8 +184,8 @@ class TestEcatImage(TestCase):
183184
img = image_class.load(example_file)
184185

185186
def test_file(self):
186-
assert self.img.file_map['header'].filename == self.example_file
187-
assert self.img.file_map['image'].filename == self.example_file
187+
assert pathlib.Path(self.img.file_map['header'].filename) == pathlib.Path(self.example_file)
188+
assert pathlib.Path(self.img.file_map['image'].filename) == pathlib.Path(self.example_file)
188189

189190
def test_save(self):
190191
tmp_file = 'tinypet_tmp.v'

0 commit comments

Comments
 (0)