diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-26 09:51:42 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-26 09:51:42 (GMT) |
| commit | 6fef14d7f399b9089a14d4ff64047f2fbd7034f3 (patch) | |
| tree | db3d9341d06fbf170b04734182de8de20da63d35 /Lib/test/test_itertools.py | |
| parent | 01b3a08f5ee6f1ffa4ab52e2e9ecd43e0b56bdd9 (diff) | |
| download | cpython-6fef14d7f399b9089a14d4ff64047f2fbd7034f3.zip cpython-6fef14d7f399b9089a14d4ff64047f2fbd7034f3.tar.gz cpython-6fef14d7f399b9089a14d4ff64047f2fbd7034f3.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 6f933c5..db9f437 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): |
