Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2024-09-08 18:20:25 +0200
committerArthur de Jong <arthur@arthurdejong.org>2024-09-08 18:27:06 +0200
commitc002d92df42398987bd08947cdc4fcbef6295872 (patch)
treec0d4b514488b0d98d77285a1bd2bf54e888d3499
parentc3f744db315f823b72b9138e84f7fe887cc670fb (diff)
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%)
-rw-r--r--setup.cfg2
-rw-r--r--tests/test_write.doctest4
-rw-r--r--tox.ini2
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
<?xml version="1.0" encoding="UTF-8"?>
<pskc:KeyContainer ... Version="1.0">
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=