diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-26 09:52:06 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-26 09:52:06 (GMT) |
commit | 5bb893c44b9fd8304b91a5033e10cc868af8fba1 (patch) | |
tree | f0ab53cd19be60f5953a6eb78221339497724431 /Lib | |
parent | ace3ad3bf79a8a3b0ea9d1de97c8f8b59d1ac7b2 (diff) | |
download | cpython-5bb893c44b9fd8304b91a5033e10cc868af8fba1.zip cpython-5bb893c44b9fd8304b91a5033e10cc868af8fba1.tar.gz cpython-5bb893c44b9fd8304b91a5033e10cc868af8fba1.tar.bz2 |
Optimize the test for issue #13454.
Now it requires almost 4x less memory and is almost 2x faster.
Diffstat (limited to 'Lib')
-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 66e307d..dfa371e 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): |