@@ -13,29 +13,31 @@ objects at runtime.
13
13
objects at runtime.
14
14
15
15
To run the tests, follow the [ setup instructions] ( ../CONTRIBUTING.md#preparing-the-environment )
16
- in the ` CONTRIBUTING.md ` document. In particular, we recommend running with Python 3.8 or 3.9 .
16
+ in the ` CONTRIBUTING.md ` document. In particular, we recommend running with Python 3.8+ .
17
17
18
18
## mypy\_ test.py
19
19
20
- This test requires Python 3.6 or higher; Python 3.6.1 or higher is recommended.
21
- Run using:
20
+ This test requires Python 3.7+. Run using:
22
21
```
23
22
(.venv3)$ python3 tests/mypy_test.py
24
23
```
25
24
26
- This test is shallow — it verifies that all stubs can be
25
+ The test has four parts. Each part uses mypy with slightly different configuration options:
26
+ - Running mypy on the stdlib stubs
27
+ - Running mypy on the third-party stubs
28
+ - Running mypy ` --strict ` on the scripts in the ` tests ` directory
29
+ - Running mypy ` --strict ` on the regression tests in the ` test_cases ` directory.
30
+
31
+ When running mypy on the stubs, this test is shallow — it verifies that all stubs can be
27
32
imported but doesn't check whether stubs match their implementation
28
- (in the Python standard library or a third-party package). It has an exclude list of
29
- modules that are not tested at all, which also lives in the tests directory.
33
+ (in the Python standard library or a third-party package).
30
34
31
- You can restrict mypy tests to a single version by passing ` -p2 ` or ` -p3.9 ` :
32
- ``` bash
33
- (.venv3)$ python3 tests/mypy_test.py -p3.9
34
- ```
35
+ Run ` python tests/mypy_test.py --help ` for information on the various configuration options
36
+ for this test script.
35
37
36
38
## pytype\_ test.py
37
39
38
- This test requires Python between 3.6 and 3.9 .
40
+ This test requires Python 3.7+ .
39
41
Note: this test cannot be run on Windows
40
42
systems unless you are using Windows Subsystem for Linux.
41
43
@@ -48,18 +50,19 @@ This test works similarly to `mypy_test.py`, except it uses `pytype`.
48
50
49
51
## pyright\_ test.py
50
52
51
- This test requires [ Node.js] ( https://nodejs.org ) to be installed. It is
52
- currently not part of the CI ,
53
- but it uses the same pyright version and configuration as the CI.
53
+ This test requires [ Node.js] ( https://nodejs.org ) to be installed. Although
54
+ typeshed runs pyright in CI, it does not currently use this script. However ,
55
+ this script uses the same pyright version and configuration as the CI.
54
56
```
55
57
(.venv3)$ python3 tests/pyright_test.py # Check all files
56
58
(.venv3)$ python3 tests/pyright_test.py stdlib/sys.pyi # Check one file
57
59
(.venv3)$ python3 tests/pyright_test.py -p pyrightconfig.stricter.json # Check with the stricter config.
58
60
```
59
61
60
62
` pyrightconfig.stricter.json ` is a stricter configuration that enables additional
61
- checks that would typically fail on incomplete stubs (such as ` Unknown ` checks),
62
- and is run on a subset of stubs (including the standard library).
63
+ checks that would typically fail on incomplete stubs (such as ` Unknown ` checks).
64
+ In typeshed's CI, pyright is run with these configuration settings on a subset of
65
+ the stubs in typeshed (including the standard library).
63
66
64
67
## check\_ consistent.py
65
68
@@ -102,7 +105,7 @@ stubtest can also help you find things missing from the stubs.
102
105
103
106
## stubtest\_ third\_ party.py
104
107
105
- This test requires Python 3.6 or higher .
108
+ This test requires Python 3.7+ .
106
109
Run using
107
110
```
108
111
(.venv3)$ python3 tests/stubtest_third_party.py
0 commit comments