From 411dfd871c25355def5599319a45c906f9121282 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 7 Nov 2015 16:54:48 +0200 Subject: [PATCH] Issue #22643: Skip test_case_operation_overflow on computers with low memory. --- Lib/test/test_unicode.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 2cc1d7c3ff9..d6644657bab 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -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