Skip to content

Commit dfb521b

Browse files
author
hauntsaninja
committed
README.md: document stubtest_test.py
1 parent a3342fa commit dfb521b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ runs tests against [mypy](https://github.com/python/mypy/)
9898
typeshed.
9999
- `tests/check_consistent.py` checks certain files in typeshed remain
100100
consistent with each other.
101+
- `tests/stubtest_test.py` checks stubs against the objects at runtime.
101102
- `flake8` enforces a style guide.
102103

103104
### Setup
@@ -155,6 +156,27 @@ than the other tests.
155156

156157
Run using: `python3 tests/check_consistent.py`
157158

159+
### stubtest_test.py
160+
161+
This test requires Python 3.5 or higher.
162+
Run using `(.venv3)$ python3 tests/stubtest_test.py`
163+
164+
This test compares the stdlib stubs against the objects at runtime. Because of
165+
this, the output depends on which version of Python it is run with.
166+
If you need a specific version of Python to repro a CI failure,
167+
[pyenv](https://github.com/pyenv/pyenv) can help (as can enabling Travis CI on
168+
your fork).
169+
170+
Due to its dynamic nature, you may run into false positives. In this case, you
171+
can add to the whitelists for each affected Python version in
172+
`tests/stubtest_whitelists`. Please file issues for stubtest false positives
173+
at [mypy](https://github.com/python/mypy/issues).
174+
175+
To run stubtest against third party stubs, it's easiest to
176+
[use stubtest directly](https://github.com/python/mypy/blob/master/scripts/stubtest.py).
177+
stubtest can also help you find things missing from the stubs.
178+
179+
158180
### flake8
159181

160182
flake8 requires Python 3.6 or higher. Run using: `(.venv3)$ flake8`

0 commit comments

Comments
 (0)