8000 AttributeError: 'NoneType' object has no attribute '__case_tag__' · Issue #11 · jianbing/utx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
AttributeError: 'NoneType' object has no attribute '__case_tag__' #11
Open
@ssfanli

Description

@ssfanli

现象

  1. 重写unittest的__init__、setUpClass 和 tearDownClass到BaseUnittest
  2. 在HomePageTest 中继承
  3. 用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):
        ......

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0