MCPcopy Create free account
hub / github.com/numpy/numpy / test_path

Method test_path

numpy/core/tests/test_memmap.py:79–92  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

77 del fp
78
79 def test_path(self, tmp_path):
80 tmpname = tmp_path / "mmap"
81 fp = memmap(Path(tmpname), dtype=self.dtype, mode='w+',
82 shape=self.shape)
83 # os.path.realpath does not resolve symlinks on Windows
84 # see: https://bugs.python.org/issue9949
85 # use Path.resolve, just as memmap class does internally
86 abspath = str(Path(tmpname).resolve())
87 fp[:] = self.data[:]
88 assert_equal(abspath, str(fp.filename.resolve()))
89 b = fp[:1]
90 assert_equal(abspath, str(b.filename.resolve()))
91 del b
92 del fp
93
94 def test_filename_fileobj(self):
95 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