diff --git a/modules/django.py b/modules/django.py index 46d3aad..a4cac84 100644 --- a/modules/django.py +++ b/modules/django.py @@ -124,10 +124,12 @@ def manage(args="", workingdir=None, prefix=None, suffix=None): @task 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 + coveragerc file is only locaterd in share/coverage/setup.cfg + TODO: test if coverage is installed and if it isn't give an error explaining the problem """ @@ -143,13 +145,19 @@ def coverage(args="help", workingdir=None, outputdir=None, if 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: outputpath = outputdir else: - outputpath = "{projectroot}/share".format( - projectroot=configuration.paths.project.root, - outputdir=outputdir) + outputpath = coveragepath outputpath += "/htmlcov" suffix += " -d %s" % outputpath