Commit 6d95c710 authored by Stefan Behnel's avatar Stefan Behnel

extended test case

parent 5c45b258
...@@ -26,6 +26,21 @@ StopIteration ...@@ -26,6 +26,21 @@ StopIteration
123 123
""" """
if IS_PY3:
__doc__ += """
>>> next(123)
Traceback (most recent call last):
TypeError: int object is not an iterator
"""
def test_next_not_iterable(it):
"""
>>> test_next_not_iterable(123)
Traceback (most recent call last):
TypeError: int object is not an iterator
"""
return next(it)
def test_single_next(it): def test_single_next(it):
""" """
>>> it = iter([1,2,3]) >>> it = iter([1,2,3])
...@@ -60,14 +75,6 @@ def test_default_next(it, default): ...@@ -60,14 +75,6 @@ def test_default_next(it, default):
""" """
return next(it, default) return next(it, default)
def test_next_not_iterable(it):
"""
>>> test_next_not_iterable(123)
Traceback (most recent call last):
TypeError: int object is not an iterator
"""
return next(it)
def test_next_override(it): def test_next_override(it):
""" """
>>> it = iter([1,2,3]) >>> it = iter([1,2,3])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment