@@ -30,7 +30,7 @@ Add the test in this format anywhere in the file:
3030with text "abc..."
3131- note a space after ` E: ` and ` flags: `
3232- ` # E:12 ` adds column number to the expected error
33- - use ` \ ` to escape the ` # ` character and indicate that the rest of the line is part of
33+ - use ` \ ` to escape the ` # ` character and indicate that the rest of the line is part of
3434the error message
3535- repeating ` # E: ` several times in one line indicates multiple expected errors in one line
3636- ` W: ... ` and ` N: ... ` works exactly like ` E: ` , but report a warning and a note respectively
@@ -88,29 +88,32 @@ module:
8888
8989 $ python2 -m pip install -U typing
9090
91- The unit test suites are driven by the ` pytest ` framework. To run all tests,
91+ The unit test suites are driven by the ` pytest ` framework. To run all mypy tests,
9292run ` pytest ` in the mypy repository:
9393
94- $ pytest
95-
96- Note that some tests will be disabled for older python versions.
94+ $ pytest mypy
9795
9896This will run all tests, including integration and regression tests,
99- and will type check mypy and verify that all stubs are valid. This may
100- take several minutes to run, so you don't want to use this all the time
101- while doing development.
97+ and will verify that all stubs are valid. This may take several minutes to run,
98+ so you don't want to use this all the time while doing development.
10299
103100Test suites for individual components are in the files ` mypy/test/test*.py ` .
104101
102+ Note that some tests will be disabled for older python versions.
103+
104+ If you work on mypyc, you will want to also run mypyc tests:
105+
106+ $ pytest mypyc
107+
105108You can run tests from a specific module directly, a specific suite within a
106- module, or a test in a suite (even if it's data-driven):
109+ module, or a test in a suite (even if it's data-driven):
107110
108111 $ pytest mypy/test/testdiff.py
109112
110113 $ pytest mypy/test/testsemanal.py::SemAnalTypeInfoSuite
111-
114+
112115 $ pytest -n0 mypy/test/testargs.py::ArgSuite::test_coherence
113-
116+
114117 $ pytest -n0 mypy/test/testcheck.py::TypeCheckSuite::testCallingVariableWithFunctionType
115118
116119To control which tests are run and how, you can use the ` -k ` switch:
@@ -144,10 +147,19 @@ To run the linter:
144147
145148 $ flake8
146149
147- You can also run all of the above tests together with:
150+ You can also run all of the above tests using ` runtests.py ` (this includes
151+ type checking mypy and linting):
148152
149153 $ python3 runtests.py
150154
155+ By default, this runs everything except some mypyc tests. You can give it
156+ arguments to control what gets run, such as ` self ` to run mypy on itself:
157+
158+ $ python3 runtests.py self
159+
160+ Run ` python3 runtests.py mypyc-extra ` to run mypyc tests that are not
161+ enabled by default. This is typically only needed if you work on mypyc.
162+
151163Many test suites store test case descriptions in text files
152164(` test-data/unit/*.test ` ). The module ` mypy.test.data ` parses these
153165descriptions.
0 commit comments