-@wvtest
-def test_next():
- with no_lingering_errors():
- # Test whatever you end up with for next() after import '*'.
- WVPASSEQ(next(iter([]), None), None)
- x = iter([1])
- WVPASSEQ(next(x, None), 1)
- WVPASSEQ(next(x, None), None)
- x = iter([1])
- WVPASSEQ(next(x, 'x'), 1)
- WVPASSEQ(next(x, 'x'), 'x')
- WVEXCEPT(StopIteration, next, iter([]))
- x = iter([1])
- WVPASSEQ(next(x), 1)
- WVEXCEPT(StopIteration, next, x)
-
-
-@wvtest
-def test_fallback_next():
- with no_lingering_errors():
- global next
- orig = next
- next = helpers._fallback_next
- try:
- test_next()
- finally:
- next = orig
-