From 0063989ba5caa5eebbed44ea244abbf4d4f60964 Mon Sep 17 00:00:00 2001 From: ronny abraham Date: Tue, 4 Jul 2023 02:17:35 +0300 Subject: [PATCH] fixed bug in django.coverage that was caused because django.manage has to at least call on the test module when being used otherwise if I don't pass it anything it blows up --- modules/django.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/django.py b/modules/django.py index cd46834..058dd78 100644 --- a/modules/django.py +++ b/modules/django.py @@ -123,7 +123,7 @@ def manage(args="help", workingdir=None, prefix="", suffix=""): @task -def coverage(args="", workingdir=None, outputdir=None, +def coverage(args="test", workingdir=None, outputdir=None, coveragerc=False, report=True, html=True): """ helper method that uses the coverage package @@ -139,20 +139,20 @@ def coverage(args="", workingdir=None, outputdir=None, suffix = "" - if report: - suffix += "&& coverage report" - - 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( + prefix += " --rcfile={coveragepath}/setup.cfg".format( coveragepath=coveragepath) + if report: + suffix += " && coverage report" + + if html: + suffix += " && coverage html" + if outputdir: outputpath = outputdir