第一种
import pytest
import os
if __name__ == "__main__":
pytest.main(['-v', 'test_pjy_pinjuan.py', '--html=./report/test_report.html']) # 报告里面更详细可以看到返回的text
第二种
import pytest
import os
if __name__ == "__main__":
pytest.main(['-v', '-q', '--alluredir', './report'])
os.system("allure generate --clean report")