Skip to content

Conversation

@patchback
Copy link

@patchback patchback bot commented Nov 29, 2025

This is a backport of PR #13930 as merged into main (922b603).

Addresses #13973

Summary

Previously, pytest command-line options were only visible via pytest --help, making them difficult to discover and browse online. This PR adds a dedicated CLI options reference page to improve discoverability and provide a better documentation experience.

Changes

Added a new documentation page (doc/en/how-to/cli-options.rst) that organizes commonly used pytest CLI options into logical categories:

  • Running and Selecting Tests (-k, -m, -x, --maxfail, --lf, --ff, --sw)
  • Output and Verbosity (-v, -q, --tb, -l, -r)
  • Reporting and Output Files (--junit-xml, --durations, -s)
  • Collection and Test Discovery (--collect-only, --pyargs, --ignore)
  • Debugging (--pdb, --trace, --fixtures, --setup-show)
  • Configuration (-c, --basetemp, -o)
  • Logging (--log-cli-level, --log-level, --log-file)
  • Warnings (--disable-warnings, -W)
  • Common Option Combinations for typical workflows

Each section includes clear examples, brief explanations, and cross-references to related documentation. The page also links to the complete command-line flag reference for users who need the exhaustive list.

Files Changed

  • Added doc/en/how-to/cli-options.rst - new CLI options reference page (307 lines)
  • Updated doc/en/how-to/index.rst - added the new page to the table of contents
  • Added changelog/4492.doc.rst - changelog entry

Testing

The documentation was successfully built using Sphinx with no errors. All cross-references are valid and the generated HTML renders correctly.

Co-authored-by: Ran Benita <[email protected]>
(cherry picked from commit 922b603)
@bluetech bluetech merged commit bd08e85 into 9.0.x Nov 29, 2025
33 checks passed
@bluetech bluetech deleted the patchback/backports/9.0.x/922b60377a38238b282c062e9589fdbe7eac1804/pr-13930 branch November 29, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants