eric7/DebugClients/Python/coverage/cmdline.py

branch
eric7
changeset 8527
2bd1325d727e
parent 8312
800c432b34c8
child 8775
0802ae193343
--- a/eric7/DebugClients/Python/coverage/cmdline.py	Fri Aug 20 19:56:17 2021 +0200
+++ b/eric7/DebugClients/Python/coverage/cmdline.py	Sat Aug 21 14:21:44 2021 +0200
@@ -31,6 +31,10 @@
         '-a', '--append', action='store_true',
         help="Append coverage data to .coverage, otherwise it starts clean each time.",
     )
+    keep = optparse.make_option(
+        '', '--keep', action='store_true',
+        help="Keep original coverage files, otherwise they are deleted.",
+    )
     branch = optparse.make_option(
         '', '--branch', action='store_true',
         help="Measure branch coverage in addition to statement coverage.",
@@ -215,6 +219,7 @@
             help=None,
             ignore_errors=None,
             include=None,
+            keep=None,
             module=None,
             omit=None,
             contexts=None,
@@ -333,6 +338,7 @@
         "combine",
         [
             Opts.append,
+            Opts.keep,
             ] + GLOBAL_ARGS,
         usage="[options] <path1> <path2> ... <pathN>",
         description=(
@@ -585,7 +591,7 @@
             if options.append:
                 self.coverage.load()
             data_dirs = args or None
-            self.coverage.combine(data_dirs, strict=True)
+            self.coverage.combine(data_dirs, strict=True, keep=bool(options.keep))
             self.coverage.save()
             return OK
 
@@ -765,7 +771,7 @@
                 self.coverage.load()
                 data = self.coverage.get_data()
                 print(info_header("data"))
-                print("path: %s" % self.coverage.get_data().data_filename())
+                print("path: %s" % data.data_filename())
                 if data:
                     print("has_arcs: %r" % data.has_arcs())
                     summary = line_counts(data, fullpath=True)

eric ide

mercurial