Repository: zhmcclient/zhmc-prometheus-exporter (language: python)

Issue:
Test: Fixed coverage reporting (locally and on coveralls.io)
No review needed.


Discussion / hints:

Fix patch:
diff --git a/.coveragerc b/.coveragerc
index 169c7065..4761f459 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,7 +1,27 @@
+# Config file for Python "coverage" package.
+#
+# For documentation, see:
+# http://coverage.readthedocs.org/en/latest/config.html
+
 [run]
 
+# Controls whether branch coverage is measured, vs. just statement coverage.
+# TODO: Once statement coverage gets better, enable branch coverage.
+branch = False
+
 # If True, stores relative file paths in data file (needed for Github Actions).
 # Using this parameter requires coverage>=5.0
 relative_files = True
 
-omit = zhmc_prometheus_exporter/test.py
+# The following files are omitted in the coverage.
+omit =
+    zhmc_prometheus_exporter/vendor/*
+
+[report]
+
+# Controls whether lines without coverage are shown in the report.
+show_missing = True
+
+[html]
+
+directory = htmlcov
diff --git a/Makefile b/Makefile
index d75f27f5..4077e1f2 100644
--- a/Makefile
+++ b/Makefile
@@ -165,8 +165,8 @@ else
   pytest_opts := $(TESTOPTS)
 endif
 
-pytest_cov_opts := --cov $(package_name) --cov-config .coveragerc --cov-append --cov-report=html:htmlcov
-pytest_cov_files := .coveragerc
+pytest_cov_rc_file := .coveragerc
+pytest_cov_opts := --cov $(package_name) --cov-config $(pytest_cov_rc_file) --cov-append --cov-report=html
 
 ifeq ($(PACKAGE_LEVEL),minimum)
   pip_level_opts := -c minimum-constraints.txt
@@ -326,7 +326,7 @@ endif
 	echo "done" >$@
 
 .PHONY: test
-test: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done $(pytest_cov_files)
+test: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done $(pytest_cov_rc_file)
 	@echo "Makefile: Performing unit tests and coverage with PACKAGE_LEVEL=$(PACKAGE_LEVEL)"
 	@echo "Makefile: Note that the warning about an unknown metric is part of the tests"
 	pytest $(pytest_cov_opts) -s $(test_dir) $(pytest_opts)
diff --git a/docs/changes.rst b/docs/changes.rst
index 28d06508..a1e6ecbc 100644
--- a/docs/changes.rst
+++ b/docs/changes.rst
@@ -28,6 +28,8 @@ Released: not yet
 
 **Bug fixes:**
 
+* Test: Fixed coverage reporting (locally and on coveralls.io).
+
 **Enhancements:**
 
 **Cleanup:**


Test patch:
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 00000000..e69de29b