From: Serhiy Storchaka Date: Sat, 7 Nov 2015 14:54:48 +0000 (+0200) Subject: Issue #22643: Skip test_case_operation_overflow on computers with low memory. X-Git-Tag: v3.5.1rc1~82^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=411dfd871c25355def5599319a45c906f9121282;p=thirdparty%2FPython%2Fcpython.git Issue #22643: Skip test_case_operation_overflow on computers with low memory. --- diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 2cc1d7c3ff92..d6644657bab1 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