Skip to content

Allow junit_suite_name to be set on any grouping of tests and in a nested manner #13960

@sebovzeoueb

Description

@sebovzeoueb

What's the problem this feature will solve?

Currently it's only possible to set the name of the root suite when running tests, but other frameworks such as jest will create nested test suite elements using the labels provided in the test files. I'm using a JUnit merging tool to assemble several test reports into one file and it uses the test suite names to do so, all my tests from the JavaScript portion of the project using jest are neatly sorted into groups but all my pytest results get lumped into a single suite, I can mitigate this slightly with the junit_suite_name option in the CLI but it only applies to the root element and doesn't support nesting.

Describe the solution you'd like

I think a function you can call anywhere in the file structure that sets a suite name would work here. For example if you call it in the __init__.py of a module, that whole module will be under that suite name, you could also call it in a file, class or individual test. If there were a call at the module level and another at the file level, this would create a file suite nested inside the module suite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: junitxmlrelated to the junitxml builtin plugintype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions