Skip to content

Commit

Permalink
Dev/eccles/remove unnecessary unittests (#17)
Browse files Browse the repository at this point in the history
* Build about.py in builder image

Problem:
Creating about.py in host environmant fails if python setuptools is
unavailable

Solution:
Create about.py using docker image.

Signed-off-by: Paul Hewlett <phewlett76@gmail.com>

* Suppress unittest coverage for timestamp.py

Problem:
Timestamp.py is so simple it does not warrant unittests.

Solution:
Add correct method of suppressing unittests for individual files and
remove unittests for timestamp.py.

Signed-off-by: Paul Hewlett <phewlett76@gmail.com>
  • Loading branch information
eccles authored May 11, 2021
1 parent 5c7e1c5 commit 35851dc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tasks:
about:
desc: Generate about.py
cmds:
- ./scripts/version.sh
- ./scripts/builder.sh ./scripts/version.sh
status:
- test -s archivist/about.py

Expand Down
4 changes: 2 additions & 2 deletions archivist/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def set_logger(level):
Setup logger
Also used by unittests
"""
LOGGER.setLevel(level) # pragma: no cover
if not LOGGER.hasHandlers(): # pragma: no cover
LOGGER.setLevel(level)
if not LOGGER.hasHandlers():
handler = logging.StreamHandler()
handler.setFormatter(
logging.Formatter(
Expand Down
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ max-line-length = 88

[coverage:report]
fail_under = 100

[coverage:run]
omit =
# utility
archivist/logger.py
# so simple - not worth testing
archivist/timestamp.py
41 changes: 0 additions & 41 deletions unittests/testtimestamp.py

This file was deleted.

0 comments on commit 35851dc

Please sign in to comment.