mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Improve test-suite documentation (#7756)
- mypy_test and pyright no longer just test the stubs, they now also test other parts of typeshed as well. - pytype_test.py can now be run on 3.10, meaning the whole test suite can now also be run on 3.10. - Various test scripts now have from `__future__ import annotations`, meaning they can now only be run on 3.7+. - Clean up the description of pyright_test.py, which had a slightly confusing wording. - Also fix the `--dry-run` config option in mypy_test.py, which I accidentally broke in #7746
This commit is contained in:
@@ -358,7 +358,10 @@ def test_the_test_scripts(code: int, major: int, minor: int, args: argparse.Name
|
||||
flags = get_mypy_flags(args, major, minor, None, strict=True, test_suite_run=True)
|
||||
print(f"Testing the test suite ({num_test_files_to_test} files)...")
|
||||
print("Running mypy " + " ".join(flags))
|
||||
this_code = subprocess.run([sys.executable, "-m", "mypy", "tests", *flags]).returncode
|
||||
if args.dry_run:
|
||||
this_code = 0
|
||||
else:
|
||||
this_code = subprocess.run([sys.executable, "-m", "mypy", "tests", *flags]).returncode
|
||||
code = max(code, this_code)
|
||||
return TestResults(code, num_test_files_to_test)
|
||||
|
||||
@@ -369,7 +372,10 @@ def test_the_test_cases(code: int, major: int, minor: int, args: argparse.Namesp
|
||||
flags = get_mypy_flags(args, major, minor, None, strict=True, custom_typeshed=True)
|
||||
print(f"Running mypy on the test_cases directory ({num_test_case_files} files)...")
|
||||
print("Running mypy " + " ".join(flags))
|
||||
this_code = subprocess.run([sys.executable, "-m", "mypy", "test_cases", *flags]).returncode
|
||||
if args.dry_run:
|
||||
this_code = 0
|
||||
else:
|
||||
this_code = subprocess.run([sys.executable, "-m", "mypy", "test_cases", *flags]).returncode
|
||||
code = max(code, this_code)
|
||||
return TestResults(code, num_test_case_files)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user