summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-10-02 15:15:42 -0500
committerGitHub <noreply@github.com>2018-10-02 15:15:42 -0500
commitb7ff1d3a54e2e69c82df24b658e545606f4db8e7 (patch)
treeecbe875da340a660b9b26264e54d52e3c01a02fe
parent7511d0b2b0ce924be152913c0c87e60e4065f7be (diff)
parent368f7ab3f50a826902a64080a15a17e86fa95e4c (diff)
downloadnumpy-b7ff1d3a54e2e69c82df24b658e545606f4db8e7.tar.gz
Merge pull request #12072 from tylerjereddy/memmap_test_fix_realpath
BUG: test_path() now uses Path.resolve()
-rw-r--r--numpy/core/tests/test_memmap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/core/tests/test_memmap.py b/numpy/core/tests/test_memmap.py
index 59ca28324..990d0ae26 100644
--- a/numpy/core/tests/test_memmap.py
+++ b/numpy/core/tests/test_memmap.py
@@ -81,7 +81,10 @@ class TestMemmap(object):
tmpname = mktemp('', 'mmap', dir=self.tempdir)
fp = memmap(Path(tmpname), dtype=self.dtype, mode='w+',
shape=self.shape)
- abspath = os.path.realpath(os.path.abspath(tmpname))
+ # os.path.realpath does not resolve symlinks on Windows
+ # see: https://bugs.python.org/issue9949
+ # use Path.resolve, just as memmap class does internally
+ abspath = str(Path(tmpname).resolve())
fp[:] = self.data[:]
assert_equal(abspath, str(fp.filename.resolve()))
b = fp[:1]