summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-02-06 22:45:43 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-02-06 22:45:43 (GMT)
commit2f653c19f4ef01f326692a2e2a8111eeaa4286ac (patch)
tree62b3dbd013b6fd6b69e89d2bfae617e537b67239 /Lib/test
parent6cc14a05d203868b84418a06d6c8254a4470e448 (diff)
downloadcpython-2f653c19f4ef01f326692a2e2a8111eeaa4286ac.zip
cpython-2f653c19f4ef01f326692a2e2a8111eeaa4286ac.tar.gz
cpython-2f653c19f4ef01f326692a2e2a8111eeaa4286ac.tar.bz2
Reversed UserLists are not required to support __length_hint__.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_iterlen.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/Lib/test/test_iterlen.py b/Lib/test/test_iterlen.py
index 93b77b6..75e7a16 100644
--- a/Lib/test/test_iterlen.py
+++ b/Lib/test/test_iterlen.py
@@ -45,7 +45,6 @@ import unittest
from test import test_support
from itertools import repeat
from collections import deque
-from UserList import UserList
from builtins import len as _len
n = 10
@@ -196,43 +195,6 @@ class TestListReversed(TestInvariantWithoutMutations):
d.extend(range(20))
self.assertEqual(len(it), 0)
-class TestSeqIter(TestInvariantWithoutMutations):
-
- def setUp(self):
- self.it = iter(UserList(range(n)))
-
- def test_mutation(self):
- d = UserList(range(n))
- it = iter(d)
- next(it)
- next(it)
- self.assertEqual(len(it), n-2)
- d.append(n)
- self.assertEqual(len(it), n-1) # grow with append
- d[1:] = []
- self.assertEqual(len(it), 0)
- self.assertEqual(list(it), [])
- d.extend(range(20))
- self.assertEqual(len(it), 0)
-
-class TestSeqIterReversed(TestInvariantWithoutMutations):
-
- def setUp(self):
- self.it = reversed(UserList(range(n)))
-
- def test_mutation(self):
- d = UserList(range(n))
- it = reversed(d)
- next(it)
- next(it)
- self.assertEqual(len(it), n-2)
- d.append(n)
- self.assertEqual(len(it), n-2) # ignore append
- d[1:] = []
- self.assertEqual(len(it), 0)
- self.assertEqual(list(it), []) # confirm invariant
- d.extend(range(20))
- self.assertEqual(len(it), 0)
def test_main():
@@ -249,8 +211,6 @@ def test_main():
TestSet,
TestList,
TestListReversed,
- TestSeqIter,
- TestSeqIterReversed,
]
test_support.run_unittest(*unittests)