Skip to content

docs: reference testing configuration in hatch test help#2235

Open
mvanhorn wants to merge 3 commits intopypa:masterfrom
mvanhorn:osc/2202-test-help-reference
Open

docs: reference testing configuration in hatch test help#2235
mvanhorn wants to merge 3 commits intopypa:masterfrom
mvanhorn:osc/2202-test-help-reference

Conversation

@mvanhorn
Copy link
Copy Markdown

@mvanhorn mvanhorn commented Apr 7, 2026

Summary

Adds a note to the hatch test command help text pointing users to --show and the testing configuration docs page. Right now, the help output gives no indication that default dependencies (pytest, coverage, pytest-rerunfailures) exist, leading to confusing resolution errors when users add conflicting versions via extra-dependencies.

Changes

  • src/hatch/cli/test/__init__.py: Appended a paragraph to the command docstring mentioning the --show flag and linking to the testing configuration docs.

Fixes #2202

This contribution was developed with AI assistance (Claude Code).

Add a note to the hatch test docstring pointing users to --show and
the testing configuration docs. Without this, dependency conflicts
from built-in defaults are confusing because the help output gives no
indication that default dependencies exist.

Fixes pypa#2202
Comment thread src/hatch/cli/test/__init__.py Outdated
The test environment comes with default dependencies (pytest, coverage, etc.). Use the
`-s`/`--show` option to see the full resolved configuration for each environment.
To customize dependencies or other settings, see the
[testing configuration](https://hatch.pypa.io/latest/config/internal/testing/).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use markdown in help text, just use the direct URL.

Addresses review from @cjames23: markdown syntax doesn't render in CLI
help output, so the `[testing configuration](...)` link appeared as-is
to users. Use the plain URL on its own line.
@mvanhorn
Copy link
Copy Markdown
Author

@cjames23 good catch - fixed in 40e8f0b. Replaced the markdown link with the plain URL on its own line, since Click doesn't render markdown in help output.

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.

Docs/UX: hatch test -h should reference testing configuration and default dependencies

2 participants