Skip to content

Instantly share code, notes, and snippets.

@k4ml k4ml/
Last active Dec 14, 2015

What would you like to do?
Example of test generator
from import validate_recipient
class TestSender(object):
def test_valid_recipients(self):
valid_recipients = (
def check_valid(recipient):
assert validate_recipient(recipient) == True
for recipient in valid_recipients:
check_valid.__name__ = 'test_valid_recipients_%s' % recipient
yield check_valid, recipient
# When executed, report will look like:-
test_valid_recipients_681919191 .... OK
test_valid_recipients_781881199 .... OK
test_valid_recipients_718188181 .... OK
Run 3 tests OK, 0 Fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.