Skip to content

Instantly share code, notes, and snippets.

@jaycody
Created November 11, 2017 07:17
Show Gist options
  • Save jaycody/0f3b83ffa52078f3747ef15655c439d6 to your computer and use it in GitHub Desktop.
Save jaycody/0f3b83ffa52078f3747ef15655c439d6 to your computer and use it in GitHub Desktop.
Generator with next() for running next test. Yield?
## assuming function: test_check_this()
## Generator runs each test
T = [10, -10, 'h', [], {}, '', 1.0, None, check_this('16'), '\n']
G = (test_check_this(test_val) for test_val in T)
for testable_item in T:
# run test on that testable_item
print next(G)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment