Skip to content
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)