1. Ned Batchelder
  2. coverage.py

Commits

Ned Batchelder  committed 32ea560

I like it better like this.

  • Participants
  • Parent commits 73a0186
  • Branches default

Comments (0)

Files changed (1)

File coverage/control.py

View file
  • Ignore whitespace
         Also warn about various problems collecting data.
 
         """
-        if self._measured:
-            self.data.add_line_data(self.collector.get_line_data())
-            self.data.add_arc_data(self.collector.get_arc_data())
-            self.collector.reset()
+        if not self._measured:
+            return
 
-            # If there are still entries in the source_pkgs list, then we never
-            # encountered those packages.
-            if self._warn_unimported_source:
-                for pkg in self.source_pkgs:
-                    self._warn("Module %s was never imported." % pkg)
+        self.data.add_line_data(self.collector.get_line_data())
+        self.data.add_arc_data(self.collector.get_arc_data())
+        self.collector.reset()
 
-            # Find out if we got any data.
-            summary = self.data.summary()
-            if not summary and self._warn_no_data:
-                self._warn("No data was collected.")
+        # If there are still entries in the source_pkgs list, then we never
+        # encountered those packages.
+        if self._warn_unimported_source:
+            for pkg in self.source_pkgs:
+                self._warn("Module %s was never imported." % pkg)
 
-            # Find files that were never executed at all.
-            for src in self.source:
-                for py_file in find_python_files(src):
-                    py_file = self.file_locator.canonical_filename(py_file)
+        # Find out if we got any data.
+        summary = self.data.summary()
+        if not summary and self._warn_no_data:
+            self._warn("No data was collected.")
 
-                    if self.omit_match and self.omit_match.match(py_file):
-                        # Turns out this file was omitted, so don't pull it
-                        # back in as unexecuted.
-                        continue
+        # Find files that were never executed at all.
+        for src in self.source:
+            for py_file in find_python_files(src):
+                py_file = self.file_locator.canonical_filename(py_file)
 
-                    self.data.touch_file(py_file)
+                if self.omit_match and self.omit_match.match(py_file):
+                    # Turns out this file was omitted, so don't pull it back
+                    # in as unexecuted.
+                    continue
 
-            self._measured = False
+                self.data.touch_file(py_file)
+
+        self._measured = False
 
     # Backward compatibility with version 1.
     def analysis(self, morf):