summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-02-02 02:10:47 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-02-02 02:10:47 (GMT)
commit17845c1786d8659dce42a3b906d0ae31fc1c3dac (patch)
tree4c351b2469560d399d4bf525e10a77b9a4b83ce2 /Lib/test/test_itertools.py
parent021dec1c96801401d07c8b84cb51115de641bce9 (diff)
downloadcpython-17845c1786d8659dce42a3b906d0ae31fc1c3dac.zip
cpython-17845c1786d8659dce42a3b906d0ae31fc1c3dac.tar.gz
cpython-17845c1786d8659dce42a3b906d0ae31fc1c3dac.tar.bz2
check for overflow in combinations_with_replacement (closes #23365)
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index cbb1b92..9cd3ad8 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -213,6 +213,11 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(result, list(cwr1(values, r))) # matches first pure python version
self.assertEqual(result, list(cwr2(values, r))) # matches second pure python version
+ @test_support.bigaddrspacetest
+ def test_combinations_with_replacement_overflow(self):
+ with self.assertRaises(OverflowError):
+ combinations_with_replacement("AA", 2**30)
+
@test_support.impl_detail("tuple reuse is specific to CPython")
def test_combinations_with_replacement_tuple_reuse(self):
cwr = combinations_with_replacement