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

Method test_trackfd_neg1

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

Source from the content-addressed store, hash-verified

305 self.assertEqual(os.stat(TESTFN).st_size, size)
306
307 def test_trackfd_neg1(self):
308 size = 64
309 with mmap.mmap(-1, size, trackfd=False) as m:
310 with self.assertRaises(ValueError):
311 m.size()
312 if hasattr(m, 'resize'):
313 with self.assertRaises(ValueError):
314 m.resize(size // 2)
315 self.assertEqual(len(m), size)
316 m[0] = ord('a')
317 assert m[0] == ord('a')
318
319 def test_bad_file_desc(self):
320 # Try opening a bad file descriptor...

Callers

nothing calls this directly

Calls 4

assertRaisesMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected