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

 

posted @ 2019-03-07 13:54  OTAKU_nicole  阅读(1252)  评论(0编辑  收藏  举报