diff --git a/Lib/test/test_iterlen.py b/Lib/test/test_iterlen.py index 93b77b606a2..75e7a16bf76 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)