summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index ce03b1a..e12aa41 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -243,6 +243,18 @@ class TestBasicOps(unittest.TestCase):
self.assertRaises(TypeError, tee, 3)
self.assertRaises(TypeError, tee, [1,2], 'x')
+ try:
+ class A(tee): pass
+ except TypeError:
+ pass
+ else:
+ self.fail("tee constructor should not be subclassable")
+
+ # tee_iterator should not be instantiable
+ a, b = tee(xrange(10))
+ self.assertRaises(TypeError, type(a))
+ self.assert_(a is iter(a)) # tee_iterator should support __iter__
+
def test_StopIteration(self):
self.assertRaises(StopIteration, izip().next)