Skip to content

Gathering some test run statistics at the end of the test run and displaying them in summary section #534

Open
@MartykQ

Description

@MartykQ

Hi all!

I have a situation where I do some REST API calls during pytest run. Each request is saved in DB with the session_id field which is either some random uuid generated in session scoped fixture or testrun_uid fixture from pytest-xdist

At the end of the session I would like to query my database that holds all needed data and gather some statistics, for example, a number of made requests/average response time and display it in the summary section.

I was thinking of using

def pytest_html_results_summary(prefix, summary, postfix):
    """Called before adding the summary section to the report"""

but the issue is there is no access to my session id fixture from there.

Has somebody faced the similar issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionThis PR is asking whether it is possible to achieve a certain outcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions