Merge pull request 'dev' (#14) from dev into master

Reviewed-on: https://chacha.ddns.net/gitea/chacha/chacha_cicd_helper/pulls/14
new-tag:0.3.4
This commit was merged in pull request #14.
This commit is contained in:
2023-11-06 14:33:31 +01:00
3 changed files with 19 additions and 1 deletions

View File

@@ -35,3 +35,5 @@ try: # pragma: no cover
except PackageNotFoundError: # pragma: no cover
warnings.warn('can not read dist.metadata["Name"], assuming local test context, setting it to <chacha_cicd_helper>')
__Name__ = "chacha_cicd_helper"
from .coverage_tools import CoverageProcess

View File

@@ -0,0 +1,16 @@
from coverage import Coverage
from multiprocessing import Process
import os
class CoverageProcess(Process):
def run(self):
cov = Coverage(config_file=True, data_suffix=os.getpid(), auto_data=True)
cov._warn_no_data = False
cov.start()
try:
super().run()
finally:
cov.stop()
cov.save()

View File

@@ -64,8 +64,8 @@ class cl_unit_test(cl_helper_withresults_base):
print("Test Finished")
if cls.enable_coverage_check is True:
cov.stop()
cov.combine()
cov.save()
cov.combine()
cov.html_report(directory=str(CoverageReportPath))
cov.xml_report(outfile=str(CoverageReportPath / f"{cls.CoverageReportName}.xml"))