Skip to content

Commit 27279ec

Browse files
miettalclaude
andcommitted
Add tests for --list-install-types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c3b6749 commit 27279ec

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

test-data/unit/cmdline.test

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,38 @@ error: --install-types not supported without python executable or site packages
941941
[out]
942942
pkg.py:1: error: "int" not callable
943943

944+
[case testCmdlineListInstallTypesConflictsWithInstallTypes]
945+
# cmd: mypy --list-install-types --install-types -m pkg
946+
[out]
947+
error: --install-types and --list-install-types cannot be used together
948+
== Return code: 2
949+
950+
[case testCmdlineListInstallTypesRequiresIncremental]
951+
# cmd: mypy --list-install-types --no-incremental -m pkg
952+
[file pkg.py]
953+
1 + 2
954+
[out]
955+
error: --list-install-types not supported with incremental mode disabled
956+
== Return code: 2
957+
958+
[case testCmdlineListInstallTypesNothingToDo]
959+
# cmd: mypy --list-install-types -m pkg
960+
[file pkg.py]
961+
1()
962+
[out]
963+
pkg.py:1: error: "int" not callable
964+
965+
[case testCmdlineListInstallTypesMissingStubs]
966+
# cmd: mypy --list-install-types --no-site-packages -m pkg
967+
[file pkg.py]
968+
import requests
969+
[out]
970+
pkg.py:1: error: Library stubs not installed for "requests"
971+
pkg.py:1: note: Hint: "python3 -m pip install types-requests"
972+
pkg.py:1: note: (or run "mypy --install-types" to install all missing stub packages)
973+
pkg.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
974+
types-requests
975+
944976
[case testCmdlineExclude]
945977
# cmd: mypy --exclude abc .
946978
[file abc/apkg.py]

0 commit comments

Comments
 (0)