Skip to content

Add a long form "--report-chars" to pytest. #14023

@junhaoliao

Description

@junhaoliao

What's the problem this feature will solve?

The -r option ("report chars") in pytest currently has no corresponding long-form option. This is inconsistent with other CLI flags, which typically support both short and long forms (e.g., -q / --quiet, -v / --verbose). The lack of a --report-chars long form makes the CLI less discoverable and less self-documenting, especially for users who prefer explicit and descriptive long options.

group._addoption( # private to use reserved lower-case short option
"-r",

Describe the solution you'd like

Add a long-form CLI option equivalent to -r, such as:

--report-chars

This flag would behave exactly like -r and accept the same character sets.

Example:

pytest --report-chars=fE
pytest --report-chars=a

This makes pytest's CLI more consistent and easier to understand.

Alternative Solutions

Possible workarounds include:

  • Using only the short-form -r option (current state).
  • Asking users to use a wrapper script or shell alias.

None address the core inconsistency in pytest's CLI.

Additional context

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