From 3f3d449e2ec4db11170920f247c3e4ff8b429f5d Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Wed, 18 Oct 2023 10:43:44 +0200 Subject: [PATCH] Switch test runner to pytest And add generation of coverage reports while I'm at it. --- .gitignore | 1 + tox.ini | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 69e04c6..5ca1da6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ src/zinolib/version.py build dist htmlcov +reports/ debian/changelog diff --git a/tox.ini b/tox.ini index 45937f8..f686b22 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,8 @@ commands = passenv = DATABASE_URL deps = - coverage + pytest + pytest-cov setenv = LC_ALL=C.UTF-8 @@ -55,8 +56,9 @@ setenv = PYTHONPATH = {toxinidir}/src PYTHONWARNINGS=once::DeprecationWarning +usedevelop = True commands = - coverage run -m unittest {posargs} + pytest -o junit_suite_name="{envname} unit tests" --cov={toxinidir}/src --cov-report=xml:reports/{envname}/coverage.xml --junitxml=reports/{envname}/unit-results.xml --verbose {posargs} [coverage:run] source = ./src/.