Created
May 24, 2017 17:38
-
-
Save snebel29/5e1ef47f6dabcefde9a2d4a7212f3237 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| class TestGen(unittest.TestCase): | |
| def test_generator(self): | |
| def gen(): | |
| i = 1 | |
| while i < 10: | |
| yield i | |
| i += 1 | |
| for i in gen(): | |
| print(i) | |
| assert(1, next(gen())) | |
| assert(2, next(gen())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment