Skip to content

docs: fix CliRunner.invoke() docstring to reference 'app' parameter#1473

Open
Mohamed-Elwasila wants to merge 1 commit into
fastapi:masterfrom
Mohamed-Elwasila:fix-clirunner-docstring
Open

docs: fix CliRunner.invoke() docstring to reference 'app' parameter#1473
Mohamed-Elwasila wants to merge 1 commit into
fastapi:masterfrom
Mohamed-Elwasila:fix-clirunner-docstring

Conversation

@Mohamed-Elwasila

Copy link
Copy Markdown
Contributor

What I Fixed

The CliRunner.invoke() method had outdated documentation that referenced a cli parameter, but the actual parameter is called app.

Why This Matters

When developers use CliRunner for testing, they see documentation mentioning a parameter that doesn't exist. This happens because Typer's CliRunner inherits the docstring from Click's version, which uses different parameter names.

Now the docs correctly show that you pass in a Typer application object via the app parameter.

Changes Made

  • Changed :param cli: to :param app: in the docstring
  • Added a note explaining this is a Typer-specific wrapper around Click's CliRunner

The invoke() method in Typer's CliRunner accepts an 'app' parameter
(Typer application) instead of 'cli' (Click command). Updated the
docstring to accurately reflect this Typer-specific parameter and
clarify that this is a wrapper around Click's CliRunner.
@svlandeg svlandeg added the docs Improvements or additions to documentation label Jan 5, 2026
@github-actions github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label May 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has a merge conflict that needs to be resolved.

@svlandeg svlandeg self-assigned this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Automatically generated when a PR has a merge conflict docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants