eric7/DebugClients/Python/coverage/summary.py

branch
eric7
changeset 8527
2bd1325d727e
parent 8312
800c432b34c8
child 8775
0802ae193343
diff -r 587202572b10 -r 2bd1325d727e eric7/DebugClients/Python/coverage/summary.py
--- a/eric7/DebugClients/Python/coverage/summary.py	Fri Aug 20 19:56:17 2021 +0200
+++ b/eric7/DebugClients/Python/coverage/summary.py	Sat Aug 21 14:21:44 2021 +0200
@@ -8,7 +8,7 @@
 from coverage import env
 from coverage.report import get_analysis_to_report
 from coverage.results import Numbers
-from coverage.misc import NotPython, CoverageException, output_encoding
+from coverage.misc import CoverageException, output_encoding
 
 
 class SummaryReporter(object):
@@ -78,29 +78,18 @@
         lines = []
 
         for (fr, analysis) in self.fr_analysis:
-            try:
-                nums = analysis.numbers
+            nums = analysis.numbers
 
-                args = (fr.relative_filename(), nums.n_statements, nums.n_missing)
-                if self.branches:
-                    args += (nums.n_branches, nums.n_partial_branches)
-                args += (nums.pc_covered_str,)
-                if self.config.show_missing:
-                    args += (analysis.missing_formatted(branches=True),)
-                text = fmt_coverage % args
-                # Add numeric percent coverage so that sorting makes sense.
-                args += (nums.pc_covered,)
-                lines.append((text, args))
-            except Exception:
-                report_it = not self.config.ignore_errors
-                if report_it:
-                    typ, msg = sys.exc_info()[:2]
-                    # NotPython is only raised by PythonFileReporter, which has a
-                    # should_be_python() method.
-                    if typ is NotPython and not fr.should_be_python():
-                        report_it = False
-                if report_it:
-                    self.writeout(self.fmt_err % (fr.relative_filename(), typ.__name__, msg))
+            args = (fr.relative_filename(), nums.n_statements, nums.n_missing)
+            if self.branches:
+                args += (nums.n_branches, nums.n_partial_branches)
+            args += (nums.pc_covered_str,)
+            if self.config.show_missing:
+                args += (analysis.missing_formatted(branches=True),)
+            text = fmt_coverage % args
+            # Add numeric percent coverage so that sorting makes sense.
+            args += (nums.pc_covered,)
+            lines.append((text, args))
 
         # Sort the lines and write them out.
         if getattr(self.config, 'sort', None):
@@ -120,8 +109,8 @@
         for line in lines:
             self.writeout(line[0])
 
-        # Write a TOTAl line if we had more than one file.
-        if self.total.n_files > 1:
+        # Write a TOTAL line if we had at least one file.
+        if self.total.n_files > 0:
             self.writeout(rule)
             args = ("TOTAL", self.total.n_statements, self.total.n_missing)
             if self.branches:

eric ide

mercurial