1. # -*- coding: utf-8 -*-
2. # @Time : 2021/10/16
3. # @Author : 大海
4. # @File : test_26.py
5. import os
6.
7. import pytest
8.
9.
10. @pytest.mark.homepage
11. class TestHomePage(object):
12.
13. @pytest.mark.test1
14. def test_one(self):
15. print('这是case1')
16.
17. @pytest.mark.test2
18. def test_two(self):
19. print('这是case2')
20.
21. def test_another(self):
22. print('这是其他case')
23.
24.
25. @pytest.mark.myapage
26. class TestMyPage(object):
27.
28. @pytest.mark.test3
29. def test_three(self):
30. print('这是case3')
31.
32. @pytest.mark.test4
33. def test_four(self):
34. print('这是case4')
35.
36.
37. if __name__ == "__main__":
38. # 执行时使用-m参数 后面是想要执行的自定义的标记
39. os.system('pytest -s -m homepage')