美文网首页
setUpClass tearDownClass使用

setUpClass tearDownClass使用

作者: 望月成三人 | 来源:发表于2017-04-25 18:55 被阅读512次
class TestInterfaceCase(unittest.TestCase):
    def __init__(self, methodName='runTest'):
        super(TestInterfaceCase, self).__init__(methodName)
    @classmethod
    def setUpClass(cls, casename):
        cls.driver = selenium_testcase()
        cls.cb = webCase.WebCaseBase(driver=cls.driver, casename=casename)
      ...

  @classmethod
   def tearDownClass(cls):
           pass
class testRightLogin(TestInterfaceCase):
    @classmethod
    def setUpClass(cls):
        super(testRightLogin, cls).setUpClass(casename="testRightLogin")
    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

    def test_login(cls):
        cls.cb.execCase(PATH("../yaml/rightLogin.yaml"))

    def test_setting(cls):
        cls.cb.execCase(PATH("../yaml/setting.yaml"))

相关文章

网友评论

      本文标题:setUpClass tearDownClass使用

      本文链接:https://www.haomeiwen.com/subject/uuxbzttx.html