import os def pytest_sessionfinish(session, exitstatus): # pytest 结束后自动生成 allure 报告 os.system("allure generate 测试报告 -o 测试报告/html --clean")