From: Serhiy Storchaka Date: Sat, 26 Jan 2013 09:51:42 +0000 (+0200) Subject: Optimize the test for issue #13454. X-Git-Tag: v2.7.4rc1~164^2~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6fef14d7f399b9089a14d4ff64047f2fbd7034f3;p=python Optimize the test for issue #13454. Now it requires almost 4x less memory and is almost 2x faster. --- diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 6f933c56da..db9f437d37 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -908,10 +908,8 @@ class TestBasicOps(unittest.TestCase): # Issue 13454: Crash when deleting backward iterator from tee() def test_tee_del_backward(self): - forward, backward = tee(xrange(20000000)) - for i in forward: - pass - + forward, backward = tee(repeat(None, 20000000)) + any(forward) # exhaust the iterator del backward def test_StopIteration(self):