conftest.py
@pytest.hookimpl(tryfirst=True,hookwrapper=True)
def pytest_runtest_makereport(item,call):函数名字是固定的,就指定的那些
out = yield
outcome=out.get_result()
if outcome.when==“call” and outcome. failed:
allure. attach. file(r’c:jpg
','filename=,attachment_type=allure.attachment_type. JPG
')