1. cburroughs
  2. coverage.py

Commits

Ned Batchelder  committed b126b84

Last refactor dropped some important arguments.

  • Participants
  • Parent commits c95a922
  • Branches default

Comments (0)

Files changed (2)

File coverage/cmdline.py

View file
         if settings.get('combine'):
             self.coverage.combine()
 
-        ignore_errors = settings.get('ignore-errors')
+        # Remaining actions are reporting, with some common options.
         show_missing = settings.get('show-missing')
         directory = settings.get('directory=')
+        report_args = {
+            'morfs': args,
+            'ignore_errors': settings.get('ignore-errors'),
+            }
 
         omit = settings.get('omit=')
         if omit:
             omit = omit.split(',')
+        report_args['omit_prefixes'] = omit
         
         if settings.get('report'):
-            self.coverage.report(morfs=args, show_missing=show_missing, ignore_errors=ignore_errors, omit_prefixes=omit)
+            self.coverage.report(show_missing=show_missing, **report_args)
         if settings.get('annotate'):
-            self.coverage.annotate(morfs=args, directory=directory, ignore_errors=ignore_errors, omit_prefixes=omit)
+            self.coverage.annotate(directory=directory, **report_args)
         if settings.get('html'):
-            self.coverage.html_report(morfs=args, directory=directory, ignore_errors=ignore_errors, omit_prefixes=omit)
+            self.coverage.html_report(directory=directory, **report_args)
 
         return OK
     

File coverage/control.py

View file
             statements, excluded, missing, format_lines(statements, missing)
             )
 
-    def report(self, morfs, show_missing=True, ignore_errors=False, file=None, omit_prefixes=None):
+    def report(self, morfs, show_missing=True, ignore_errors=False, file=None,
+                omit_prefixes=None
+                ):
         """Write a summary report to `file`.
         
         Each module in `morfs` is listed, with counts of statements, executed
         reporter = SummaryReporter(self, show_missing, ignore_errors)
         reporter.report(morfs, outfile=file, omit_prefixes=omit_prefixes)
 
-    def annotate(self, morfs, directory=None, ignore_errors=False, omit_prefixes=None):
+    def annotate(self, morfs, directory=None, ignore_errors=False,
+                omit_prefixes=None
+                ):
         """Annotate a list of modules.
         
         Each module in `morfs` is annotated.  The source is written to a new
         
         """
         reporter = AnnotateReporter(self, ignore_errors)
-        reporter.report(morfs, directory)
+        reporter.report(morfs, directory=directory, omit_prefixes=omit_prefixes)
 
-    def html_report(self, morfs, directory=None, ignore_errors=False, omit_prefixes=None):
+    def html_report(self, morfs, directory=None, ignore_errors=False,
+                omit_prefixes=None
+                ):
         """Generate an HTML report.
         
         """
         reporter = HtmlReporter(self, ignore_errors)
-        reporter.report(morfs, outfile=file, omit_prefixes=omit_prefixes)
+        reporter.report(morfs, directory=directory, omit_prefixes=omit_prefixes)