这是我的代码
class M(unittest.TestCase):
@classmethod
def setUpClass(cls):
# init webdriver
def test_1(self):
# login the web
def test_2(self):
# check the dashboard after login
@classmethod
def tearDownClass(cls):
# quit driver
当我运行代码时,驱动程序在函数test_1
完成运行后退出,如何在test_2
之前运行tearDownClass
?