From: Serhiy Storchaka Date: Mon, 2 Feb 2015 23:35:10 +0000 (+0200) Subject: Issues #23363, #23364, #23365, #23366: Fixed itertools overflow tests. X-Git-Tag: v3.4.3rc1~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5e8e5755586820a278326e2aa55b8ff755f0a59;p=python Issues #23363, #23364, #23365, #23366: Fixed itertools overflow tests. Used PyMem_New to check overflow. --- b5e8e5755586820a278326e2aa55b8ff755f0a59 diff --cc Lib/test/test_itertools.py index 207ee9e3d0,bb3b61fdce..244598b752 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@@ -428,12 -420,10 +428,10 @@@ class TestBasicOps(unittest.TestCase) @support.bigaddrspacetest def test_permutations_overflow(self): - with self.assertRaises(OverflowError): + with self.assertRaises((OverflowError, MemoryError)): permutations("A", 2**30) - with self.assertRaises(OverflowError): - permutations("A", 2, 2**30) - @support.impl_detail("tuple resuse is CPython specific") + @support.impl_detail("tuple reuse is specific to CPython") def test_permutations_tuple_reuse(self): self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1)