From: Serhiy Storchaka Date: Sat, 26 Jan 2013 09:52:06 +0000 (+0200) Subject: Optimize the test for issue #13454. X-Git-Tag: v3.2.4rc1~186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5bb893c44b9fd8304b91a5033e10cc868af8fba1;p=thirdparty%2FPython%2Fcpython.git 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 66e307da5a93..dfa371e2b866 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -932,10 +932,8 @@ class TestBasicOps(unittest.TestCase): # Issue 13454: Crash when deleting backward iterator from tee() def test_tee_del_backward(self): - forward, backward = tee(range(20000000)) - for i in forward: - pass - + forward, backward = tee(repeat(None, 20000000)) + any(forward) # exhaust the iterator del backward def test_StopIteration(self):