[Python-checkins] cpython (3.4): Issue #22643: Skip test_case_operation_overflow on computers with low memory.

serhiy.storchaka python-checkins at python.org
Sat Nov 7 09:56:00 EST 2015


https://hg.python.org/cpython/rev/5fae49ef94fd
changeset:   99001:5fae49ef94fd
branch:      3.4
parent:      98997:2071d16ed5e6
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Nov 07 16:54:48 2015 +0200
summary:
  Issue #22643: Skip test_case_operation_overflow on computers with low memory.

files:
  Lib/test/test_unicode.py |  10 +++++++++-
  1 files changed, 9 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -820,7 +820,15 @@
     @support.cpython_only
     def test_case_operation_overflow(self):
         # Issue #22643
-        self.assertRaises(OverflowError, ("ü"*(2**32//12 + 1)).upper)
+        size = 2**32//12 + 1
+        try:
+            s = "ü" * size
+        except MemoryError:
+            self.skipTest('no enough memory (%.0f MiB required)' % (size / 2**20))
+        try:
+            self.assertRaises(OverflowError, s.upper)
+        finally:
+            del s
 
     def test_contains(self):
         # Testing Unicode contains method

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


More information about the Python-checkins mailing list