Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Created July 2, 2020 09:58
Show Gist options
  • Save prashanth-sams/6ca723f8c4c7337b35b5e51a86abc244 to your computer and use it in GitHub Desktop.
Save prashanth-sams/6ca723f8c4c7337b35b5e51a86abc244 to your computer and use it in GitHub Desktop.
Python Yield
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