1.我把driver的实例化写到suit里了,比如:
suite = unittest.TestSuite()
base_driver = BaseDriver()
driver = base_driver.android_driver()
tests = [LoginTest('test_success',parame=driver), LoginTest('test_user_error',parame=driver), MeTest('test_entry_me_page',parame=driver)]
suite.addTests(tests)
2.然后又单独创建了一个ParameTestCase类,代码如下:
def __init__(self,methodName='runTest',parame=None):
super(ParameTestCase,self).__init__(methodName)
global parames
parames = parame
3.有两个页面,login页面和me页面
login的case层部分代码如下:
class LoginTest(ParameTestCase):
@classmethod
def setUpClass(cls):
cls.business = LoginBusiness(parames)
me页面case层的部分代码如下:
class MeTest(ParameTestCase):
@classmethod
def setUpClass(cls):
cls.meBusiness = MeBusiness(parames)
但是,这两个case层的setUpClass方法里,parames都报错,This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items
请问是什么问题呢?