MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / test_next_operator

Function test_next_operator

tests/python/test_dict_methods.py:545–557  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

543
544# next operator
545def test_next_operator():
546 myit = pm.eval('function* makeIt() { yield 1; yield 2; }; makeIt')()
547 first = next(myit)
548 assert (first == 1.0)
549 second = next(myit)
550 assert (second == 2.0)
551 try:
552 third = next(myit)
553 assert (False)
554 except StopIteration as e:
555 assert (True)
556 fourth = next(myit, 'default')
557 assert fourth == 'default'
558
559
560def test_next_operator_non_iterator():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected