Skip to content

Commit f0306d3

Browse files
committed
BF - test for presence of created file during temp directory use
We were using samefile here - in the 1.1.0 development line, in order to deal with temporary directories having several names due to links or some such on mac. ``samefile`` does not exist on 2.6.5 for windows.
1 parent b8dfa87 commit f0306d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nibabel/tmpdirs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ class InTemporaryDirectory(TemporaryDirectory):
5656
>>> import os
5757
>>> my_cwd = os.getcwd()
5858
>>> with InTemporaryDirectory() as tmpdir:
59-
... assert os.getcwd() != my_cwd
60-
... assert os.path.samefile(os.getcwd(), tmpdir)
59+
... open('test.txt', 'wt').write('some text')
60+
... assert os.path.isfile('test.txt')
61+
... assert os.path.isfile(os.path.join(tmpdir, 'test.txt'))
6162
>>> os.path.exists(tmpdir)
6263
False
6364
>>> os.getcwd() == my_cwd

0 commit comments

Comments
 (0)