Skip to content

Commit

Permalink
Issues python#1621, python#29145: Test for str.join() overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vadmium committed Jan 12, 2017
1 parent 52e2907 commit b71c095
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Lib/test/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,13 @@ def __str__(self): return self.sval
self.checkraises(TypeError, ' ', 'join', [1, 2, 3])
self.checkraises(TypeError, ' ', 'join', ['1', '2', 3])

@unittest.skipIf(sys.maxsize > 2**32,
'needs too much memory on a 64-bit platform')
def test_join_overflow(self):
size = int(sys.maxsize**0.5) + 1
seq = ('A' * size,) * size
self.assertRaises(OverflowError, ''.join, seq)

def test_replace(self):
string_tests.CommonTest.test_replace(self)

Expand Down

0 comments on commit b71c095

Please sign in to comment.