Skip to content

📝 Add docstrings to testing module#1677

Closed
mastash3ff wants to merge 1 commit into
fastapi:masterfrom
mastash3ff:docs/add-docstrings-testing
Closed

📝 Add docstrings to testing module#1677
mastash3ff wants to merge 1 commit into
fastapi:masterfrom
mastash3ff:docs/add-docstrings-testing

Conversation

@mastash3ff
Copy link
Copy Markdown

Summary

typer/testing.py shipped with no docstrings on the module, the CliRunner class, or its invoke method. This PR adds all three.

  • Module docstring — brief description of the module's purpose with a link to the testing tutorial.
  • CliRunner class docstring — explains what it extends and why, with a short usage example that mirrors the style used for the Typer class in typer/main.py.
  • CliRunner.invoke docstring — describes what the method does and delegates to for readers who land on the API reference.

No logic, behaviour, or type annotations were changed. The diff is +48 / -0 lines.

Checklist

  • Docstring style matches existing project conventions (plain prose, Markdown, links to the tutorial)
  • ruff check passes
  • ruff format --check passes
  • No test files modified
  • No logic changes

Add a module docstring, class docstring for `CliRunner`, and a method
docstring for `CliRunner.invoke` in `typer/testing.py`. All three were
undocumented. Docstrings follow the existing project style (plain prose
with Markdown and links to the relevant tutorial page).
@svlandeg svlandeg added the docs Improvements or additions to documentation label May 26, 2026
Copy link
Copy Markdown
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

This significantly bloats the file from merely 30 lines to almost 80, and I'm not sure it adds much beyond what we already have in the official documentation. I think we'll pass on this for now.

@svlandeg svlandeg closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants