From 6fef14d7f399b9089a14d4ff64047f2fbd7034f3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 26 Jan 2013 11:51:42 +0200 Subject: [PATCH] Optimize the test for issue #13454. Now it requires almost 4x less memory and is almost 2x faster. --- Lib/test/test_itertools.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 6f933c56da1..db9f437d37a 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):