-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
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.
pytest/src/_pytest/terminal.py
Lines 190 to 191 in 64e3c91
| 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-charsThis flag would behave exactly like -r and accept the same character sets.
Example:
pytest --report-chars=fE
pytest --report-chars=aThis makes pytest's CLI more consistent and easier to understand.
Alternative Solutions
Possible workarounds include:
- Using only the short-form
-roption (current state). - Asking users to use a wrapper script or shell alias.
None address the core inconsistency in pytest's CLI.