Skip to content

Commit 380df00

Browse files
Pierre-SassoulasPCManticore
authored andcommitted
[Readme] Add information on how to launch tests fast (#3040)
1 parent 4bf6f03 commit 380df00

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,33 @@ To run the test suite for a particular Python version, you can do::
117117
tox -e py37
118118

119119

120+
If you want to run tests on a specific portion of the code use pytest_, (pytest-cov_) and your local python version::
121+
122+
# ( pip install pytest-cov )
123+
# Everything:
124+
python3 -m pytest tests/
125+
# Everything in tests/message with coverage for the relevant code:
126+
python3 -m pytest tests/message/ --cov=pylint.message
127+
coverage html
128+
# Only the functional test "missing_kwoa_py3":
129+
python3 -m pytest "tests/test_functional.py::test_functional[missing_kwoa_py3]"
130+
131+
132+
It can be more than 100 times faster than tox and you can also get the coverage.
133+
10000 times if you want to launch a single functional test. First, you
134+
need to clone astroid_ and install the last version from source::
135+
136+
git clone https://github.com/PyCQA/astroid.git
137+
python3 astroid/setup.py build sdist
138+
pip3 install astroid/dist/astroid*.tar.gz
139+
120140
For more detailed information, check the documentation.
121141

122142
.. _here: http://pylint.pycqa.org/en/latest/user_guide/installation.html
123143
.. _tox: https://tox.readthedocs.io/en/latest/
144+
.. _pytest: https://docs.pytest.org/en/latest/
145+
.. _pytest-cov: https://pypi.org/project/pytest-cov/
146+
.. _astroid: https://github.com/PyCQA/astroid
124147

125148
License
126149
-------

0 commit comments

Comments
 (0)