mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Improve typechecking of the test suite (#9806)
This commit is contained in:
@@ -14,6 +14,7 @@ ReturnCode: TypeAlias = int
|
||||
|
||||
SUPPORTED_PLATFORMS = ("linux", "darwin", "win32")
|
||||
SUPPORTED_VERSIONS = ("3.11", "3.10", "3.9")
|
||||
LOWEST_SUPPORTED_VERSION = min(SUPPORTED_VERSIONS, key=lambda x: int(x.split(".")[1]))
|
||||
DIRECTORIES_TO_TEST = ("scripts", "tests")
|
||||
EMPTY: list[str] = []
|
||||
|
||||
@@ -38,7 +39,7 @@ parser.add_argument(
|
||||
choices=SUPPORTED_VERSIONS,
|
||||
nargs="*",
|
||||
action="extend",
|
||||
help="Run mypy for certain Python versions (defaults to sys.version_info[:2])",
|
||||
help=f"Run mypy for certain Python versions (defaults to {LOWEST_SUPPORTED_VERSION!r})",
|
||||
)
|
||||
|
||||
|
||||
@@ -77,7 +78,7 @@ def main() -> ReturnCode:
|
||||
args = parser.parse_args()
|
||||
directories = args.dir or DIRECTORIES_TO_TEST
|
||||
platforms = args.platform or [sys.platform]
|
||||
versions = args.python_version or [f"3.{sys.version_info[1]}"]
|
||||
versions = args.python_version or [LOWEST_SUPPORTED_VERSION]
|
||||
|
||||
code = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user