mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
merge 3.5
This commit is contained in:
commit
87845bcb4d
3 changed files with 97 additions and 113 deletions
|
@ -720,6 +720,20 @@ class MmapTests(unittest.TestCase):
|
|||
self.assertEqual(mm.write(b"yz"), 2)
|
||||
self.assertEqual(mm.write(b"python"), 6)
|
||||
|
||||
@unittest.skipIf(os.name == 'nt', 'cannot resize anonymous mmaps on Windows')
|
||||
def test_resize_past_pos(self):
|
||||
m = mmap.mmap(-1, 8192)
|
||||
self.addCleanup(m.close)
|
||||
m.read(5000)
|
||||
try:
|
||||
m.resize(4096)
|
||||
except SystemError:
|
||||
self.skipTest("resizing not supported")
|
||||
self.assertEqual(m.read(14), b'')
|
||||
self.assertRaises(ValueError, m.read_byte)
|
||||
self.assertRaises(ValueError, m.write_byte, 42)
|
||||
self.assertRaises(ValueError, m.write, b'abc')
|
||||
|
||||
|
||||
class LargeMmapTests(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue