Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute '__case_tag__' #11

Open
ssfanli opened this issue Aug 20, 2020 · 0 comments
Open

AttributeError: 'NoneType' object has no attribute '__case_tag__' #11

ssfanli opened this issue Aug 20, 2020 · 0 comments

Comments

@ssfanli
Copy link

ssfanli commented Aug 20, 2020

现象

  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):
        ......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant