From eab7891751321d30300b12ff928270e8b4bda265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 19 Aug 2020 09:18:38 +0200 Subject: [PATCH] Code coverage --- .gitignore | 3 +++ .gitlab-ci.yml | 5 +++++ requirements.txt | 2 -- setup.cfg | 23 ++++++++++++++++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4ef59b57..d14e2242 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ env .python_history config.toml .tox +.coverage +.coverage.* +htmlcov diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cdf1d927..7660d4fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,3 +27,8 @@ python38: image: python:3.8 stage: test script: tox -e py38 + +coverage: + image: python:3.8 + stage: test + script: tox -e coverage diff --git a/requirements.txt b/requirements.txt index 3125a996..9d33de9f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,4 @@ flask flask-babel flask-wtf python-ldap -pytest toml -pdbpp diff --git a/setup.cfg b/setup.cfg index 8283eaae..620396ad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,9 +3,30 @@ envlist = py36 py37 py38 + coverage skipsdist=True [testenv] install_command = pip install {packages} commands = {envbindir}/pytest --showlocals --full-trace {posargs} -deps = --requirement requirements.txt +deps = + pytest + pdbpp + --requirement requirements.txt + +[testenv:coverage] +skip_install = true +deps = + pdbpp + pytest + pytest-coverage + --requirement requirements.txt + +commands = + {envbindir}/pytest --cov {posargs} + coverage html + +[coverage:run] +source = + web + tests