From 30d239fb614f7adbeea0c1a043ba66977fce38ed Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Sat, 14 Mar 2020 14:37:03 -0400 Subject: [PATCH] Generate a better coverage report with 'who tests what' context (#1291) * Add `make coverage` to generate an HTML coverage report * Update `coverage` and `pytest-cov` development dependencies --- Makefile | 5 ++++- development.txt | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 70eadf9..cbdec6f 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,13 @@ format: prettier --write 'CTFd/themes/**/assets/**/*' test: - pytest --cov=CTFd --ignore=node_modules/ --disable-warnings -n auto + pytest --cov=CTFd --cov-context=test --ignore=node_modules/ --disable-warnings -n auto bandit -r CTFd -x CTFd/uploads yarn verify +coverage: + coverage html --show-contexts + serve: python serve.py diff --git a/development.txt b/development.txt index e174690..1d85aa1 100644 --- a/development.txt +++ b/development.txt @@ -1,7 +1,7 @@ -r requirements.txt pytest==4.4.0 pytest-randomly==1.2.3 -coverage==4.5.2 +coverage==5.0.3 mock==2.0.0 flake8==3.7.7 freezegun==0.3.11 @@ -12,7 +12,7 @@ moto==1.3.7 bandit==1.5.1 flask_profiler==1.7 pytest-xdist==1.28.0 -pytest-cov==2.6.1 +pytest-cov==2.8.1 sphinx_rtd_theme==0.4.3 flask-debugtoolbar==0.10.1 flake8-isort==2.8.0