Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
6d95c710
Commit
6d95c710
authored
Nov 05, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
5c45b258
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
tests/run/builtin_next.pyx
tests/run/builtin_next.pyx
+15
-8
No files found.
tests/run/builtin_next.pyx
View file @
6d95c710
...
@@ -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])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment