Skip to content

I want do somethings when failed #51

@zx490336534

Description

@zx490336534

i want have a pic when i failed
like:

@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
    out = yield
    result = out.get_result()
    if result.outcome in ['failed', 'error']:
        for k, v in item.funcargs.items():
            if hasattr(v, 'driver'):
                allure.attach.file(source='failed.png', name='failed', attachment_type=allure.attachment_type.PNG)
                break

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions