1. Ned Batchelder
  2. coverage.py

Commits

Ned Batchelder  committed e816edd

Clean up coverage_coverage.py

  • Participants
  • Parent commits 7c5fb2d
  • Branches default

Comments (0)

Files changed (1)

File test/coverage_coverage.py

View file
 HTML_DIR = "htmlcov"
 
 def run_tests_with_coverage():
+    """Run the test suite with coverage measuring itself."""
     import coverage
     
     tracer = os.environ.get('COVERAGE_TEST_TRACER', 'c')
     for name, mod in modules:
         if name.startswith('coverage'):
             if hasattr(mod, '__file__') and mod.__file__.startswith(covdir):
-                    covmods[name] = mod
-                    del sys.modules[name]
+                covmods[name] = mod
+                del sys.modules[name]
     import coverage     # don't warn about re-import: pylint: disable-msg=W0404
     sys.modules.update(covmods)
 
     cov.save()
 
 def report_on_combined_files():
-    
+    """Combine all the .coverage files and make an HTML report."""
     if os.path.exists(HTML_DIR):
         shutil.rmtree(HTML_DIR)
 
     cov.exclude("if __name__ == .__main__.:")
     cov.exclude("raise AssertionError")
     
-    cov.html_report(directory=HTML_DIR, ignore_errors=True, omit_prefixes=["mock"])
+    cov.html_report(
+        directory=HTML_DIR, ignore_errors=True, omit_prefixes=["mock"]
+        )
 
 
 try: