updated coverage to look for the coverage.rc file as setup.cfg in share/coverage and the print out htmlcov in share/coverage

This commit is contained in:
ronny abraham 2023-07-03 23:19:11 +03:00
parent eb66e2a1bf
commit b92c025f75

View file

@ -124,10 +124,12 @@ def manage(args="", workingdir=None, prefix=None, suffix=None):
@task @task
def coverage(args="help", workingdir=None, outputdir=None, def coverage(args="help", workingdir=None, outputdir=None,
report=True, html=True): coveragerc=False, report=True, html=True):
""" """
helper method that uses the coverage package helper method that uses the coverage package
coveragerc file is only locaterd in share/coverage/setup.cfg
TODO: test if coverage is installed and if it isn't give TODO: test if coverage is installed and if it isn't give
an error explaining the problem an error explaining the problem
""" """
@ -143,13 +145,19 @@ def coverage(args="help", workingdir=None, outputdir=None,
if html: if html:
suffix += "&& coverage html" suffix += "&& coverage html"
coveragepath = "{projectroot}/share/coverage".format(
projectroot=configuration.paths.project.root,
outputdir=outputdir)
if coveragerc:
suffix += " --rcfile={coveragepath}/setup.cfg".format(
coveragepath=coveragepath)
if outputdir: if outputdir:
outputpath = outputdir outputpath = outputdir
else: else:
outputpath = "{projectroot}/share".format( outputpath = coveragepath
projectroot=configuration.paths.project.root,
outputdir=outputdir)
outputpath += "/htmlcov" outputpath += "/htmlcov"
suffix += " -d %s" % outputpath suffix += " -d %s" % outputpath