Added make target for test coverage, documented make commands
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Anton Sarukhanov · committed by Anton Sarukhanov · parent 4f83f70 · Browse files · 4 files·+25 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+25 added−9 removed
- other:+25 added−9 removed
Provenance
- Commit
5cadd4a- Tree
4293163- Author
Anton Sarukhanov <code@ant.sr>- Committer
Anton Sarukhanov <code@ant.sr>- Parent
4f83f70
4 files changed+25 added−9 removed
modified:.gitignore+2 added
9 unmodified lines10 _mailinglist11 .tox12 .cache/13 .idea/14+.coverage15+htmlcovmodified:CONTRIBUTING.rst+16 added-9 removed
29 unmodified lines30 31 - Try to follow `PEP8 <http://legacy.python.org/dev/peps/pep-0008/>`_, but you32 may ignore the line-length-limit if following it would make the code uglier.33 34+Getting Started35+===============36 35-Running the testsuite36----------------------37-37 You probably want to set up a `virtualenv38 <https://virtualenv.readthedocs.io/en/latest/index.html>`_.39 41-The minimal requirement for running the testsuite is ``py.test``. You can42-install it with::43-44- pip install pytest45-40 Clone this repository::41 42 git clone https://github.com/pallets/flask.git43 1 unmodified line45 46 cd flask47 pip install --editable .48 49+Running the testsuite50+---------------------51+52+The minimal requirement for running the testsuite is ``pytest``. You can53+install it with::54+55+ pip install pytest56+57 Then you can run the testsuite with::58 59 py.test60 61+**Shortcut**: ``make test`` will ensure ``pytest`` is installed, and run it.62+59-With only py.test installed, a large part of the testsuite will get skipped63+With only pytest installed, a large part of the testsuite will get skipped64 though. Whether this is relevant depends on which part of Flask you're working65 on. Travis is set up to run the full testsuite when you submit your pull66 request anyways.67 4 unmodified lines72 73 The ``tox`` command will then run all tests against multiple combinations74 Python versions and dependency versions.75 76+**Shortcut**: ``make tox-test`` will ensure ``tox`` is installed, and run it.77+78 Running test coverage79 ---------------------80 Generating a report of lines that do not have unit test coverage can indicate where81 to start contributing. ``pytest`` integrates with ``coverage.py``, using the ``pytest-cov``10 unmodified lines92 py.test --cov-report html --cov=flask tests/93 94 Full docs on ``coverage.py`` are here: https://coverage.readthedocs.io95 96+**Shortcut**: ``make cov`` will ensure ``pytest-cov`` is installed, run it, display the results, *and* save the HTML report.modified:Makefile+5 added
5 unmodified lines6 pip install -r test-requirements.txt -q7 FLASK_DEBUG= py.test tests examples8 9 tox-test:10+ pip install -r test-requirements.txt -q11 tox12 13+cov:14+ pip install -r test-requirements.txt -q15+ FLASK_DEBUG= py.test --cov-report term --cov-report html --cov=flask --cov=examples tests examples16+17 audit:18 python setup.py audit19 20 release:29 unmodified linesmodified:test-requirements.txt+2 added
1+tox2 pytest3+pytest-cov