Skip to content
Myr

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

4 files+25 added−9 removed

modified:.gitignore+2 added
9 unmodified lines
10_mailinglist11.tox12.cache/13.idea/14.coverage15htmlcov
modified:CONTRIBUTING.rst+16 added-9 removed
29 unmodified lines
3031- 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.3334Getting Started35===============3635Running the testsuite36---------------------3737You probably want to set up a `virtualenv38<https://virtualenv.readthedocs.io/en/latest/index.html>`_.3941The minimal requirement for running the testsuite is ``py.test``. You can42install it with::4344 pip install pytest4540Clone this repository::4142 git clone https://github.com/pallets/flask.git43
1 unmodified line
4546 cd flask47 pip install --editable .4849Running the testsuite50---------------------5152The minimal requirement for running the testsuite is ``pytest``. You can53install it with::5455 pip install pytest5657Then you can run the testsuite with::5859 py.test6061**Shortcut**: ``make test`` will ensure ``pytest`` is installed, and run it.6259With only py.test installed, a large part of the testsuite will get skipped63With only pytest installed, a large part of the testsuite will get skipped64though. Whether this is relevant depends on which part of Flask you're working65on. Travis is set up to run the full testsuite when you submit your pull66request anyways.67
4 unmodified lines
7273The ``tox`` command will then run all tests against multiple combinations74Python versions and dependency versions.7576**Shortcut**: ``make tox-test`` will ensure ``tox`` is installed, and run it.7778Running test coverage79---------------------80Generating a report of lines that do not have unit test coverage can indicate where81to start contributing. ``pytest`` integrates with ``coverage.py``, using the ``pytest-cov``
10 unmodified lines
92 py.test --cov-report html --cov=flask tests/9394Full docs on ``coverage.py`` are here: https://coverage.readthedocs.io9596**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 lines
6 pip install -r test-requirements.txt -q7 FLASK_DEBUG= py.test tests examples89tox-test:10 pip install -r test-requirements.txt -q11 tox1213cov:14 pip install -r test-requirements.txt -q15 FLASK_DEBUG= py.test --cov-report term --cov-report html --cov=flask --cov=examples tests examples1617audit:18 python setup.py audit1920release:
29 unmodified lines
modified:test-requirements.txt+2 added
1tox2pytest3pytest-cov