Skip to content

Documentation: confusion between --junit-xml and --junitxml #11091

Closed
@soxofaan

Description

@soxofaan

The docs and cli help are a bit confusing around the --junitxml/--junit-xml cli option (and probably some comparable options).

pytest --help only mentions --junit-xml=path (e.g. also see https://docs.pytest.org/en/7.1.x/reference/reference.html#command-line-flags):

  --junit-xml=path      Create junit-xml style report file at given path

However, most examples in the docs (and mosts tests) use --junitxml, e.g. https://github.com/pytest-dev/pytest/blob/0ded3297a9749aabad7d3c2447dce98321741dda/doc/en/how-to/output.rst#creating-junitxml-format-files :

To create result files which can be read by Jenkins_ or other Continuous
integration servers, use this invocation:

.. code-block:: bash

    pytest --junitxml=path

to create an XML file at ``path``.

This was quite confusing to me as it seemed there was a typo somewhere and I lost time just to figure out that they are aliases actually:

group.addoption(
"--junitxml",
"--junit-xml",

Wouldn't it be better to stick to one of the two everywhere or at least more explicitly mention that they are aliases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: help wanteddevelopers would like help from experts on this topictype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions