From 47caebe843c9aa3a675f01ea53bbfac6bdebb034 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Tue, 9 Jun 2020 14:57:58 +0200 Subject: [PATCH] Simplify coverage handling - Always install coverage tools. - Show coverage if all tests pass. - Less conditional code. --- Makefile | 5 ----- setup.cfg | 7 ++++++- test-requirements.txt | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e862e36..fbe59b8 100644 --- a/Makefile +++ b/Makefile @@ -30,11 +30,6 @@ PYTEST_ARGS = TEST_EXTRA_PACKAGES = -ifeq ($(COVERAGE), true) - TEST_EXTRA_PACKAGES += pytest-cov - PYTEST_ARGS += --cov-config .coveragerc --cov vdirsyncer -endif - ifeq ($(ETESYNC_TESTS), true) TEST_EXTRA_PACKAGES += git+https://github.com/etesync/journal-manager@v0.5.2 TEST_EXTRA_PACKAGES += django djangorestframework==3.8.2 wsgi_intercept drf-nested-routers diff --git a/setup.cfg b/setup.cfg index fb86724..e3d4d5c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,12 @@ universal = 1 [tool:pytest] norecursedirs = tests/storage/servers/* -addopts = --tb=short +addopts = + --tb=short + --cov-config .coveragerc + --cov=vdirsyncer + --cov-report=term-missing + --no-cov-on-fail [flake8] # E731: Use a def instead of lambda expr diff --git a/test-requirements.txt b/test-requirements.txt index feb39a6..b6e1181 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,5 @@ hypothesis>=5.0.0 pytest +pytest-cov pytest-localserver pytest-subtesthack