From adaef16a06de8fb4f00bb08e54842b9274d361aa Mon Sep 17 00:00:00 2001 From: wiggin15 Date: Wed, 17 Apr 2013 20:08:13 +0300 Subject: [PATCH] enable cover plugin if coverage options are passed Enable coverage plugin even if --with-coverage is not specified, if an option to output coverage reports is passed (--cover-html, --cover-xml) or if an option to cover files is passed (--cover-packages, --cover-tests, --cover-inclusive) Fixes #514 --- nose/plugins/cover.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nose/plugins/cover.py b/nose/plugins/cover.py index 551f3320..604de8a5 100644 --- a/nose/plugins/cover.py +++ b/nose/plugins/cover.py @@ -101,6 +101,9 @@ def configure(self, options, conf): super(Coverage, self).configure(options, conf) if conf.worker: return + for opt in ["cover_packages", "cover_tests", "cover_inclusive", "cover_html", "cover_xml"]: + if getattr(options, opt, None) is not None: + self.enabled = True if self.enabled: try: import coverage