Skip to content

Commit

Permalink
enable cover plugin if coverage options are passed
Browse files Browse the repository at this point in the history
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 nose-devs#514
  • Loading branch information
wiggin15 authored and Arnon Yaari committed Oct 6, 2014
1 parent 08d1342 commit adaef16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nose/plugins/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit adaef16

Please sign in to comment.