MCPcopy Index your code
hub / github.com/python/cpython / test_large_filesize

Method test_large_filesize

Lib/test/test_mmap.py:1256–1266  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1254 self.assertEqual(m[0xFFFFFFF], 32)
1255
1256 def test_large_filesize(self):
1257 with self._make_test_file(0x17FFFFFFF, b" ") as f:
1258 if sys.maxsize < 0x180000000:
1259 # On 32 bit platforms the file is larger than sys.maxsize so
1260 # mapping the whole file should fail -- Issue #16743
1261 with self.assertRaises(OverflowError):
1262 mmap.mmap(f.fileno(), 0x180000000, access=mmap.ACCESS_READ)
1263 with self.assertRaises(ValueError):
1264 mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
1265 with mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ) as m:
1266 self.assertEqual(m.size(), 0x180000000)
1267
1268 # Issue 11277: mmap() with large (~4 GiB) sparse files crashes on OS X.
1269

Callers

nothing calls this directly

Calls 5

_make_test_fileMethod · 0.95
assertRaisesMethod · 0.45
filenoMethod · 0.45
assertEqualMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected