From df32d4377ddcfd4efa99bc7e7dde24f23f19f468 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 25 Jan 2022 15:35:42 +0100 Subject: [PATCH] TT#121955 py-test: add coverage for django templates https://github.com/nedbat/django_coverage_plugin Change-Id: I74a5638fea8b2460fc7bd04abe47be210c3f46bb --- repoapi/settings/test.py | 3 +++ requirements/test.txt | 1 + t/Dockerfile | 2 +- tox.ini | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/repoapi/settings/test.py b/repoapi/settings/test.py index 12e86da..63e5158 100644 --- a/repoapi/settings/test.py +++ b/repoapi/settings/test.py @@ -47,6 +47,9 @@ DATABASES = { } } +# needed for django-coverage-plugin +TEMPLATES[0]["OPTIONS"]["debug"] = True # noqa + DJANGO_LOG_LEVEL = "DEBUG" JENKINS_URL = "http://localhost" diff --git a/requirements/test.txt b/requirements/test.txt index bbe805a..afacfe9 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,2 +1,3 @@ -r common.txt +django_coverage_plugin pytest-django diff --git a/t/Dockerfile b/t/Dockerfile index 2cf980d..a27d019 100644 --- a/t/Dockerfile +++ b/t/Dockerfile @@ -5,7 +5,7 @@ FROM docker.mgm.sipwise.com/sipwise-bullseye:latest # is updated with the current date. It will force refresh of all # of the base images and things like `apt-get update` won't be using # old cached versions when the Dockerfile is built. -ENV REFRESHED_AT 2022-01-22 +ENV REFRESHED_AT 2022-01-23 RUN apt-get update && apt-get install --assume-yes python3 python3-dev \ python3-pytest python3-pytest-pep8 \ diff --git a/tox.ini b/tox.ini index 9ba38ee..f5a9630 100644 --- a/tox.ini +++ b/tox.ini @@ -22,3 +22,6 @@ omit = manage.py repoapi/settings/* repoapi/wsgi.py + venv_* +relative_files = true +plugins = django_coverage_plugin