MCPcopy Index your code
hub / github.com/python/cpython / test_new_style_iter_class

Method test_new_style_iter_class

Lib/test/test_iter.py:325–329  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

323
324 # Test a new_style class with __iter__ but no next() method
325 def test_new_style_iter_class(self):
326 class IterClass(object):
327 def __iter__(self):
328 return self
329 self.assertRaises(TypeError, iter, IterClass())
330
331 # Test two-argument iter() with callable instance
332 def test_iter_callable(self):

Callers

nothing calls this directly

Calls 2

assertRaisesMethod · 0.95
IterClassClass · 0.85

Tested by

no test coverage detected