Skip to content

Tate/help group filtering - #15538

Closed
tsuarez16 wants to merge 6 commits into
pytest-dev:mainfrom
Yumeseeker:tate/help-group-filtering
Closed

tsuarez16 wants to merge 6 commits into
pytest-dev:mainfrom
Yumeseeker:tate/help-group-filtering

Conversation

@tsuarez16

Copy link
Copy Markdown

Summary

Implements the help-output filtering for --help-group in showhelp().

  • Filtering: --help-group=<name> prints only that group's section (heading, description, options), formatted the same way as in --help. Works for custom groups and built-in ones, with or without --help.
  • Skipped sections: in group mode the ini options and environment variables sections aren't printed.
  • Tests: removed the FILTERING_PENDING marker, so the 3 filtering tests that were xfail now run as normal tests.
  • Docs: added changelog/9452.feature.rst for the whole feature (so no one else needs to add one) and added myself to AUTHORS.

Builds on #<Brian's PR number> (CLI parsing) and #<Dylan's PR number> (tests).

Related upstream issue: #9452

Testing

  • testing/test_help_group.py: 16 passed (was 13 passed, 3 xfailed).
  • testing/test_config.py + testing/test_parseopt.py: 364 passed, 1 xfailed (an existing xfail, not related).
  • Checked by hand: --help-group=debugconfig, an unknown name, no value, and plain --help.
  • Pre-commit hooks: not run.

Open questions

  • Should --help-group also show the ini options and environment variables? Right now it hides them, and the tests don't lock it in either way.
  • _anonymous still shows in the unknown group error (same as Dylan raised). Hide it, or show it as "Custom options"?

Checklist

  • Include documentation when adding new features.
  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits.
  • If AI agents were used, they are credited in Co-authored-by commit trailers.
  • Create a changelog file.
  • Add yourself to AUTHORS.

@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Dec 4, 2026
@tsuarez16

Copy link
Copy Markdown
Author

Opened against the wrong repository by mistake, sorry.

@tsuarez16 tsuarez16 closed this Dec 4, 2026
@tsuarez16
tsuarez16 deleted the tate/help-group-filtering branch December 4, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants