@@ -93,7 +93,9 @@ To run all tests, run the script `runtests.py` in the mypy repository:
93
93
Note that some tests will be disabled for older python versions.
94
94
95
95
This will run all tests, including integration and regression tests,
96
- and will type check mypy and verify that all stubs are valid.
96
+ and will type check mypy and verify that all stubs are valid. This may
97
+ take several minutes to run, so you don't want to use this all the time
98
+ while doing development.
97
99
98
100
You can run a subset of test suites by passing positive or negative
99
101
filters:
@@ -104,18 +106,23 @@ For example, to run unit tests only, which run pretty quickly:
104
106
105
107
$ ./runtests.py unit-test
106
108
107
- The unit test suites are driven by a mixture of test frameworks: mypy's own
108
- ` myunit ` framework, and ` pytest ` , which we're in the process of migrating to.
109
- Test suites for individual components are in the files ` mypy/test/test*.py ` .
110
- You can run many of these individually by doing ` runtests.py testfoobar ` . For
111
- finer control over which unit tests are run and how, you can run ` py.test ` or
112
- ` scripts/myunit ` directly, or pass inferior arguments via ` -a ` :
109
+ You can get a list of available test suites through the ` -l ` option
110
+ (though this doesn't show all available subtasks):
111
+
112
+ $ ./runtests.py -l
113
+
114
+ The unit test suites are driven by a mixture of test frameworks: ` pytest ` and
115
+ mypy's own ` myunit ` framework, which we're in the process of migrating away
116
+ from. Test suites for individual components are in the files
117
+ ` mypy/test/test*.py ` . You can run many of these individually by doing
118
+ ` runtests.py testfoobar ` . For finer control over which unit tests are run and
119
+ how, you can run ` pytest ` directly:
113
120
114
121
$ py.test mypy/test/testcheck.py -v -k MethodCall
115
- $ ./runtests.py -v 'pytest mypy/test/testcheck' -a -v -a -k -a MethodCall
116
122
117
- $ PYTHONPATH=$PWD scripts/myunit -m mypy.test.testlex -v '*backslash*'
118
- $ ./runtests.py mypy.test.testlex -a -v -a '*backslash*'
123
+ You can pass inferior arguments to pytest via ` -a ` when using ` runtests.py ` :
124
+
125
+ $ ./runtests.py pytest -a -v -a -k -a MethodCall
119
126
120
127
You can also run the type checker for manual testing without
121
128
installing it by setting up the Python module search path suitably:
@@ -163,8 +170,7 @@ the number of processes to use. The default (set in `./pytest.ini`) is the
163
170
number of logical cores; this can be overridden using ` -n ` option.
164
171
165
172
Note that running more processes than logical cores is likely to
166
- significantly decrease performance; the relevant count is the number of
167
- processes used by ` runtests.py ` plus those used by ` pytest ` .
173
+ significantly decrease performance.
168
174
169
175
170
176
Coverage reports
0 commit comments