如何在python中生成动态(参数化)单元测试?
import unittest l = [["foo", "a", "a",], ["bar", "a", "b"], ["lee", "b", "b"]]class TestSequence(unittest.TestCase): def testsample(self): for name, a,b in l: print "test", name self.assertEqual(a,b)if __name__ == '__main__': unittest.main()
德玛西亚99