utx
utx copied to clipboard
AttributeError: 'NoneType' object has no attribute '__case_tag__'
现象
- 重写unittest的__init__、setUpClass 和 tearDownClass到BaseUnittest
- 在HomePageTest 中继承
- 用tag标签
运行报错如下
File "/Users/ssfanli/Myfolder/pyproj/work/YSPCheckListAndroid/case/test_1_home_page.py", line 17, in <module>
class HomePageTest(BaseUnittest):
File "/Users/ssfanli/Myfolder/pyproj/work/YSPCheckListAndroid/utx/core.py", line 220, in __new__
setattr(test_case, CASE_TAG_FLAG, {Tag.ALL}) # 没有指定tag的用例,默认带有tag:ALL
AttributeError: 'NoneType' object has no attribute '__case_tag__'
case片段
class HomePageTest(BaseUnittest):
def setUp(self) -> None:
self.hp = HomePage(self.d)
def tearDown(self) -> None:
self.hp.auto_back()
@tag(Tag.SMOKE)
def test_recommend(self):
......