()
| 543 | |
| 544 | # next operator |
| 545 | def 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 | |
| 560 | def test_next_operator_non_iterator(): |
nothing calls this directly
no outgoing calls
no test coverage detected