Skip to content

allow the use of --show-traceback and --pdb with stubtest #18037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,8 @@ class _Arguments:
custom_typeshed_dir: str | None
check_typeshed: bool
version: str
show_traceback: bool
pdb: bool


# typeshed added a stub for __main__, but that causes stubtest to check itself
Expand Down Expand Up @@ -1938,6 +1940,8 @@ def test_stubs(args: _Arguments, use_builtins_fixtures: bool = False) -> int:
options.abs_custom_typeshed_dir = os.path.abspath(options.custom_typeshed_dir)
options.config_file = args.mypy_config_file
options.use_builtins_fixtures = use_builtins_fixtures
options.show_traceback = args.show_traceback
options.pdb = args.pdb

if options.config_file:

Expand Down Expand Up @@ -2091,6 +2095,10 @@ def parse_options(args: list[str]) -> _Arguments:
parser.add_argument(
"--version", action="version", version="%(prog)s " + mypy.version.__version__
)
parser.add_argument("--pdb", action="store_true", help="Invoke pdb on fatal error")
parser.add_argument(
"--show-traceback", "--tb", action="store_true", help="Show traceback on fatal error"
)

return parser.parse_args(args, namespace=_Arguments())

Expand Down
Loading