Created
July 2, 2020 09:58
-
-
Save prashanth-sams/6ca723f8c4c7337b35b5e51a86abc244 to your computer and use it in GitHub Desktop.
Python Yield
This file contains 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
class TestData(): | |
def test_foo(self): | |
for value in TestData.simpleGeneratorFun(): | |
print(value) | |
assert 1 == value | |
def simpleGeneratorFun(): | |
yield 1 | |
yield 2 | |
yield 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment