Skip to content

Extras added after test execution in fixture are ignored #820

@ascended121

Description

@ascended121

The docs explain that one can use the extras fixture to add content to the html report, however only some of the extras are added. In the following code:

import pytest_html

def test_extra(extras):
    extras.append(pytest_html.extras.text("before test!"))
    yield # run test
    extras.append(pytest_html.extras.text("after test!"))

only the before test part is actually added to the report. The docs don't mention anything about this behavior, so hard to tell if its a bug or not.

If this is a limitation of the framework, it would be really helpful to document it. If not, it would be really handy to fix it.

In my use case, I have a test which generates some files which I'd like to link to from the report. That has to be done after the test completes, but my links never show up in the report.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions