我想把截图附在诱惑报告上。但是,它会保持错误:
TyperError: Object of type AttachmentType is not JSON serializable
以下是我的conftest.py中的代码:
import pytest
import allure
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
if report.whem == "call" and report.failed:
with allure.step("Failure screenshot"):
allure.attach.file(r'D:\image_01.png', allure.attachment_type.PNG)
环境: 视窗10 python 3.8 pytest 6.2.2 诱惑试验2.8.36 pywinauto 0.6.8
位置参数形式导致错误。 代码应为:
相关问题 更多 >
编程相关推荐