Created
August 4, 2010 14:44
-
-
Save jacobian/508237 to your computer and use it in GitHub Desktop.
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
def tabletest(table): | |
def decorator(func): | |
def _inner(): | |
for args in table: | |
yield tuple([func] + list(args)) | |
_inner.__name__ = 'test_'+func.__name__ | |
return _inner | |
return decorator | |
table = [(1, 2), (3, 4)] | |
@tabletest(table) | |
def check_pair(left, right): | |
assert left > right |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment