Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d717d0

Browse files
Issue #22643: Skip test_case_operation_overflow on computers with low memory.
2 parents 838b7cc + 411dfd8 commit 3d717d0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Lib/test/test_unicode.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,15 @@ def test_center(self):
849849
@support.cpython_only
850850
def test_case_operation_overflow(self):
851851
# Issue #22643
852-
self.assertRaises(OverflowError, ("ü"*(2**32//12 + 1)).upper)
852+
size = 2**32//12 + 1
853+
try:
854+
s = "ü" * size
855+
except MemoryError:
856+
self.skipTest('no enough memory (%.0f MiB required)' % (size / 2**20))
857+
try:
858+
self.assertRaises(OverflowError, s.upper)
859+
finally:
860+
del s
853861

854862
def test_contains(self):
855863
# Testing Unicode contains method

0 commit comments

Comments
 (0)