]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #22643: Skip test_case_operation_overflow on computers with low memory.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 7 Nov 2015 14:54:48 +0000 (16:54 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 7 Nov 2015 14:54:48 +0000 (16:54 +0200)
Lib/test/test_unicode.py

index 2cc1d7c3ff92a488dfff4f7f7e349dae29c5689d..d6644657bab152ce4b2d2030603bdd276d068085 100644 (file)
@@ -820,7 +820,15 @@ class UnicodeTest(string_tests.CommonTest,
     @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