summaryrefslogtreecommitdiffstats
path: root/Lib
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)
commit6f082297b260d3eb4975d6d4305eba6fd26f9ae9 (patch)
tree73a5f3fd814cd728c653365dfece1ea7db2dbae6 /Lib
parent4b40eeb33901c3a520ce78ae88eb5ee06870130f (diff)
downloadcpython-6f082297b260d3eb4975d6d4305eba6fd26f9ae9.zip
cpython-6f082297b260d3eb4975d6d4305eba6fd26f9ae9.tar.gz
cpython-6f082297b260d3eb4975d6d4305eba6fd26f9ae9.tar.bz2
check for overflow in combinations_with_replacement (closes #23365)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_itertools.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 2475443..355c690 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -344,8 +344,12 @@ class TestBasicOps(unittest.TestCase):
self.pickletest(cwr(values,r)) # test pickling
- # Test implementation detail: tuple re-use
+ @support.bigaddrspacetest
+ def test_combinations_with_replacement_overflow(self):
+ with self.assertRaises(OverflowError):
+ combinations_with_replacement("AA", 2**30)
+ # Test implementation detail: tuple re-use
@support.impl_detail("tuple reuse is specific to CPython")
def test_combinations_with_replacement_tuple_reuse(self):
cwr = combinations_with_replacement