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()

 

转载于:https://www.cnblogs.com/nicole-zhang/p/10489156.html

你可能感兴趣的:(python自动化测试——参数化)