Skip to content

Instantly share code, notes, and snippets.

@jacobian
Created August 4, 2010 14:44
Show Gist options
  • Save jacobian/508237 to your computer and use it in GitHub Desktop.
Save jacobian/508237 to your computer and use it in GitHub Desktop.
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