Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Catching exceptions from iterator MoveNext(), additional testing (issue #475, original pull request #523) #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 26, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test that after exception is thrown iterator is no longer valid
  • Loading branch information
abessen committed Jun 25, 2018
commit 2131292d3ab277e89a3065ee9d488d7dd8f7364a
9 changes: 9 additions & 0 deletions src/tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ def test_iteration_exception():

assert exc == exception

# after exception is thrown iterator is no longer valid
with pytest.raises(StopIteration):
next(val)


def test_iteration_innerexception():
from Python.Test import ExceptionTest
from System import OverflowException
Expand All @@ -377,3 +382,7 @@ def test_iteration_innerexception():
exc = cm.value

assert exc == exception.InnerException

# after exception is thrown iterator is no longer valid
with pytest.raises(StopIteration):
next(val)