Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c144738

Browse files
committedMay 23, 2025·
Fix mypy errors in test_doc.py due to stripped click decorator
1 parent af5feb7 commit c144738

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎src/docstub/_cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ def report_execution_time():
126126
click.echo(f"Finished in {formated_duration}")
127127

128128

129+
# Preserve click.command below to keep type checker happy
130+
# docstub: off
129131
@click.command()
132+
# docstub: on
130133
@click.version_option(__version__)
131134
@click.argument("root_path", type=click.Path(exists=True), metavar="PACKAGE_PATH")
132135
@click.option(

‎tests/test_doc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from pathlib import Path
55

66
import click
7+
from click.testing import CliRunner
78

89
from docstub._cli import main as docstub_main
910

@@ -30,7 +31,9 @@ def test_getting_started_example(tmp_path):
3031
py_file = tmp_path / "example.py"
3132
with py_file.open("x") as io:
3233
io.write(py_source)
33-
docstub_main([str(py_file)], standalone_mode=False)
34+
runner = CliRunner()
35+
result = runner.invoke(docstub_main, [str(py_file)])
36+
assert result.exit_code == 0
3437

3538
# Load created PYI file, this is what we expect to find in the user guide's
3639
# code block for example.pyi

0 commit comments

Comments
 (0)
Please sign in to comment.