Visitar URL original
Feature request: Support for adding your own sections · Issue #82 · pytest-dev/pytest-metadata · GitHub
Skip to content

Feature request: Support for adding your own sections #82

Open

Description

@Stefanhg

Hello,
I wish to add my own section that includes test configurations so I can separate information about test env. and test config.
Is it possible to add it already or is this a feature that would be needed?
I tried to look though the source code but I can't figure out if the environment section is built into pytest-html or built into Python

Activity

  1. BeyondEvil commented on Aug 29, 2023

    @BeyondEvil
    Contributor

    Not sure what exactly you're trying to do. Can you maybe elaborate a little more?

    The environment section is part of pytest-html and you can add sections to that using the pytest-metadata plugin.

  2. Stefanhg commented on Aug 29, 2023

    @Stefanhg
    Author

    What i want is to add my own completely isolated section.
    So I don't combine environment section and my own section as this section can become rather big with many configurations I would like to hide it.

    I did conclude my own question. It is part of pytest-html and would be a feature request. I am working on right now trying to figure out how to access the set_data function though pytest session fixture but It seems like that might not be possible.

    Here is a example of what I want:
    image

  3. BeyondEvil commented on Aug 29, 2023

    @BeyondEvil
    Contributor

    You can more or less accomplish this using the pytest_html_results_summary hook.

  4. Stefanhg commented on Aug 29, 2023

    @Stefanhg
    Author

    Yeah, it could just be moved to "Summary" instead of under environment.
    But this would require me to copy in the whole function of renderStatic and all of It's sub functions right? Or do you have a smarter idea in mind?

  5. BeyondEvil commented on Aug 29, 2023

    @BeyondEvil
    Contributor

    You shouldn't have to copy or modify anything. Just build the HTML as you want it and pass it to the hook. The report will then render it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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