Python+selenium+ddt数据驱动测试

import ddt

testData = ['1','2','3']
print testData

@ddt.ddt
class Bolg(unittest.TestCase):
   
    def setUp(self):
       print('setUp')

    @ddt.data(*testData)
    def test_l(self, data):
       print(data)

    def tearDown(self):
       print('tearDown')

if __name__ == "__main__":
    unittest.main()



============
1
2
3

 

你可能感兴趣的:(Python+selenium+ddt数据驱动测试)