#206 docs: how to display code coverage
Merged 3 years ago by kparal. Opened 3 years ago by kparal.

file modified
+5 -1
@@ -6,7 +6,6 @@ 

  # cache files

  /.cache/

  /.mypy_cache/

- /.pytest_cache/

  .sass-cache/

  *__pycache__*

  
@@ -17,6 +16,11 @@ 

  *.pyc

  *.pyo

  

+ # test suite

+ /.coverage

+ /.pytest_cache/

+ /htmlcov/

+ 

  # local config

  /blockerbugs_db.sqlite*

  /*.pgdump

@@ -170,6 +170,8 @@ 

  and then visit `<http://127.0.0.1:9999/>`_.

  

  

+ .. _test_suite:

+ 

  Running Unit Tests

  ==================

  

@@ -96,6 +96,22 @@ 

  

  You can then continue with :ref:`initializing the environment <initializing_env>`.

  

+ 

+ Exploring code coverage

+ =======================

+ 

+ Code coverage will display which source code lines were/weren't executed as part

+ of the :ref:`test suite <test_suite>` execution. It will help you understand

+ what additional tests you should write when writing unit tests for a specific

+ Python module.

+ 

+ In order to display the current code coverage, run this from the project root directory::

+ 

+   pytest --cov

+ 

+ You'll see a coverage report including line numbers missing coverage in your terminal. You can also browse an interactive HTML report which highlights individual lines missing coverage in ``htmlcov/index.html``.

+ 

+ 

  Release Process

  ===============

  

file modified
+4
@@ -36,6 +36,7 @@ 

  python_functions=test should

  python_files=test_* testfunc_*

  testpaths = testing

+ addopts = --cov-config=setup.cfg --cov-report term-missing --cov-report html

  filterwarnings =

      ignore:the imp module is deprecated in favour of importlib:DeprecationWarning:koji

      ignore:defusedxml.cElementTree is deprecated, import from defusedxml.ElementTree instead:DeprecationWarning:openid
@@ -43,3 +44,6 @@ 

      ignore:'contextfunction' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.:DeprecationWarning:flask_admin

      ignore:The 'autoescape' extension is deprecated and will be removed in Jinja 3.1. This is built in now.:DeprecationWarning:jinja2

      ignore:The 'with' extension is deprecated and will be removed in Jinja 3.1. This is built in now.:DeprecationWarning:jinja2

+ 

+ [coverage:run]

+ source = blockerbugs

Adjust config files to make the coverage execution command as simple as
possible.

Fixes: https://pagure.io/fedora-qa/blockerbugs/issue/201

Build succeeded.

Commit 5ac068f fixes this pull-request

Pull-Request has been merged by kparal

3 years ago