Created
May 3, 2013 12:18
-
-
Save gnurag/5508789 to your computer and use it in GitHub Desktop.
Auto adding tests.
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
import unittest | |
class AutoTest(unittest.TestCase): | |
def check(self, x, y): | |
self.assertEquals(x, y) | |
for x in xrange(0,4): | |
for y in xrange(0, 4): | |
def lcheck(x, y): | |
return lambda self: self.check(x, y) | |
setattr(AutoTest, "test_%r_%r_equality" % (x, y) , lcheck(x, y)) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment