python自动化测试——参数化
import unittest import paramunittest @paramunittest.parametrized( {"server": "AAA","url": "AAA_URL"}, {"server": "BBB","url": "BBB_URL"}, {"server": "CCC","url": "CCC_URL"}, ) class check_server(unittest.TestCase): def setParameters(self, server, url): self.server = server self.url = url def test_check(self): print("server:",self.server) print("url:", self.url) if __name__ == "__main__": unittest.main()
本文来自博客园,作者:OTAKU_nicole,转载请注明原文链接:https://www.cnblogs.com/nicole-zhang/p/10489156.html