pytest+pycharm 批量运行测试用例
if __name__ =="__main__": #运行标记为markA的用例,并生成测试报告 pytest.main(["-m=markA","--html=report.html"]) 大部分资料中都说要在terminal终端运行,所以个人习惯直接写在os.system()里,相对上面的写法,下面这种就是终端怎么写这里怎么写就可以了。 if __name__ =="__main__": #运行标记为markA的用例,并生成测试报告 os.system('pytest -m "markA" --html=report.html --self-contained-html') 来源: https://www.cnblogs.com/nicole-zhang/p/11387316.html