MCPcopy Index your code
hub / github.com/numpy/numpy / test_path

Method test_path

numpy/_core/tests/test_memmap.py:86–99  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

84 del fp
85
86 def test_path(self, tmp_path):
87 tmpname = tmp_path / "mmap"
88 fp = memmap(Path(tmpname), dtype=self.dtype, mode='w+',
89 shape=self.shape)
90 # os.path.realpath does not resolve symlinks on Windows
91 # see: https://bugs.python.org/issue9949
92 # use Path.resolve, just as memmap class does internally
93 abspath = str(Path(tmpname).resolve())
94 fp[:] = self.data[:]
95 assert_equal(abspath, str(fp.filename.resolve()))
96 b = fp[:1]
97 assert_equal(abspath, str(b.filename.resolve()))
98 del b
99 del fp
100
101 def test_filename_fileobj(self):
102 fp = memmap(self.tmpfp, dtype=self.dtype, mode="w+",

Callers

nothing calls this directly

Calls 2

memmapClass · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected