summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-26 09:54:27 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-26 09:54:27 (GMT)
commitdd399af438e02506fb2e1978ae040c3f3e4a21d7 (patch)
tree289a7b3a7183f4374ecee63b9bce5e4e6289a3be /Lib
parent591c4282d70a8aaebe9823ee5b74c27707e9d40d (diff)
parent1c7181d764c3aa031de690865ed9f49296b86029 (diff)
downloadcpython-dd399af438e02506fb2e1978ae040c3f3e4a21d7.zip
cpython-dd399af438e02506fb2e1978ae040c3f3e4a21d7.tar.gz
cpython-dd399af438e02506fb2e1978ae040c3f3e4a21d7.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.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 835ae33..fdf7984 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):