[Python-checkins] cpython (2.7): skip test if resizing is not supported

benjamin.peterson python-checkins at python.org
Thu Oct 6 01:00:13 EDT 2016


https://hg.python.org/cpython/rev/48797808a302
changeset:   104318:48797808a302
branch:      2.7
user:        Benjamin Peterson <benjamin at python.org>
date:        Wed Oct 05 22:00:05 2016 -0700
summary:
  skip test if resizing is not supported

files:
  Lib/test/test_mmap.py |  7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -656,9 +656,12 @@
         m = mmap.mmap(-1, 8192)
         self.addCleanup(m.close)
         m.read(5000)
-        m.resize(4096)
+        try:
+            m.resize(4096)
+        except SystemError:
+            self.skipTest("resizing not supported")
         self.assertEqual(m.read(14), '')
-        self.assertRaises(ValueError, m.read_byte,)
+        self.assertRaises(ValueError, m.read_byte,1)
         self.assertRaises(ValueError, m.write_byte, 'b')
         self.assertRaises(ValueError, m.write, 'abc')
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list