From bbd6c8c791ffa0f9f30f31d17e47e8fe8e587526 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 3 Jun 2016 14:32:10 -0700 Subject: [PATCH] Expanding contribution documentation (#1883) - README updated with link to CONTRIBUTING.rst - CONTRIBUTING.rst has instructions on running code coverage --- CONTRIBUTING.rst | 19 +++++++++++++++++++ README | 2 ++ 2 files changed, 21 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 67eb3061..ca7b4af2 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -68,3 +68,22 @@ of ``pytest``. You can install it with:: The ``tox`` command will then run all tests against multiple combinations Python versions and dependency versions. + +Running test coverage +--------------------- +Generating a report of lines that do not have unit test coverage can indicate where +to start contributing. ``pytest`` integrates with ``coverage.py``, using the ``pytest-cov`` +plugin. This assumes you have already run the testsuite (see previous section):: + + pip install pytest-cov + +After this has been installed, you can output a report to the command line using this command:: + + py.test --cov=flask tests/ + +Generate a HTML report can be done using this command:: + + py.test --cov-report html --cov=flask tests/ + +Full docs on ``coverage.py`` are here: https://coverage.readthedocs.io + diff --git a/README b/README index d0e3c521..baea6b24 100644 --- a/README +++ b/README @@ -37,6 +37,8 @@ $ py.test + Details on contributing can be found in CONTRIBUTING.rst + ~ Where can I get help? Either use the #pocoo IRC channel on irc.freenode.net or