如果你还想从头学起Pytest,可以看看这个系列的文章哦!
https://www.cnblogs.com/poloyy/category/1690628.html
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = __Time__ = 2020/4/9 19:32 __Author__ = 小菠萝测试笔记 __Blog__ = https://www.cnblogs.com/poloyy/ """ import pytest @pytest.mark.weibo def test_weibo(): print("测试微博") def test_toutiao(): print("测试头条") class TestClass: def test_method(self): print("测试新浪")
pytest -m weibo 08_mark.py
pytest -m "not weibo" 08_mark.py
原文:https://www.cnblogs.com/poloyy/p/12669068.html