From c002d92df42398987bd08947cdc4fcbef6295872 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 8 Sep 2024 18:20:25 +0200 Subject: Have tests fail on missing coverage This also only prints missed coverage on the terminal after the tests. Fixes 1d6e115 (removed requirement) and e99f7c8 (reduced coverage below 100%) --- setup.cfg | 2 +- tests/test_write.doctest | 4 ++-- tox.ini | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2018910..a35b935 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,7 +9,7 @@ group=root universal = 1 [tool:pytest] -addopts = --doctest-modules --doctest-glob="*.doctest" pskc tests --cov=pskc --cov-report=term-missing --cov-report=html +addopts = --doctest-modules --doctest-glob="*.doctest" pskc tests --cov=pskc --cov-report=term-missing:skip-covered --cov-report=html doctest_optionflags = IGNORE_EXCEPTION_DETAIL [coverage:run] diff --git a/tests/test_write.doctest b/tests/test_write.doctest index 3b6196a..c1ea198 100644 --- a/tests/test_write.doctest +++ b/tests/test_write.doctest @@ -1,6 +1,6 @@ test_write.doctest - tests for writing PSKC files -Copyright (C) 2014-2022 Arthur de Jong +Copyright (C) 2014-2024 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -318,7 +318,7 @@ specified and we assume to use the encryption key as MAC key). If we decrypt the file the MAC key will be included in encrypted form. ->>> pskc.encryption.derive_key('qwerty') +>>> pskc.encryption.derive_key(b'qwerty') >>> pskc.write(sys.stdout) #doctest: +ELLIPSIS +REPORT_UDIFF diff --git a/tox.ini b/tox.ini index 6cde845..595610a 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = pytest signxml: defusedxml lxml: lxml defusedxml: defusedxml -commands = signxml: pytest +commands = signxml: pytest --cov-fail-under 100 legacy: pytest --ignore=tests/test_signature.doctest --cov-fail-under 95 lxml: pytest --ignore=tests/test_signature.doctest --cov-fail-under 95 setenv= -- cgit v1.2.3