From 6d95c710310e0d82e15efb24247fc38bde370dbb Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 5 Nov 2010 19:17:56 +0100 Subject: [PATCH] extended test case --- tests/run/builtin_next.pyx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/run/builtin_next.pyx b/tests/run/builtin_next.pyx index 53a75cbd..d090c53b 100644 --- a/tests/run/builtin_next.pyx +++ b/tests/run/builtin_next.pyx @@ -26,6 +26,21 @@ StopIteration 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): """ >>> it = iter([1,2,3]) @@ -60,14 +75,6 @@ def test_default_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): """ >>> it = iter([1,2,3]) -- 2.26.2