diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-26 09:53:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-26 09:53:17 (GMT) |
commit | 1c7181d764c3aa031de690865ed9f49296b86029 (patch) | |
tree | a8d1505b877b2215fa1a2ec359a374d6db7eb578 /Lib/test/test_itertools.py | |
parent | 73e38809e01113ca586056eaf603737c60b1009e (diff) | |
parent | 5bb893c44b9fd8304b91a5033e10cc868af8fba1 (diff) | |
download | cpython-1c7181d764c3aa031de690865ed9f49296b86029.zip cpython-1c7181d764c3aa031de690865ed9f49296b86029.tar.gz cpython-1c7181d764c3aa031de690865ed9f49296b86029.tar.bz2 |
Optimize the test for issue #13454.
Now it requires almost 4x less memory and is almost 2x faster.
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r-- | Lib/test/test_itertools.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index efd50ba..53926a9 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -1269,10 +1269,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): |