Skip to content

Commit 8fc4d19

Browse files
committed
BF: avoid relpath in test if not needed
relpath giving errors testing on Windows when code not on the same drive as test. Avoid using relpath unless the relpath really needs to be ``..``, in which case test will still error, but as a way of failing.
1 parent b0a3325 commit 8fc4d19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/externals/tests/test_ordereddict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
def test_right_version():
1414
# If Python < 2.7, use our own copy, else use system copy
15-
class_path = inspect.getfile(OrderedDict)
16-
rel_dir = dirname(relpath(realpath(class_path), MY_PATH))
1715
if sys.version_info[:2] < (2, 7):
16+
class_path = realpath(inspect.getfile(OrderedDict))
17+
rel_dir = dirname(relpath(class_path, MY_PATH))
1818
assert_equal(rel_dir, '..')
1919
else:
2020
import collections

0 commit comments

Comments
 (0)