diff options
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/control.py | 3 | ||||
-rw-r--r-- | coverage/data.py | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/coverage/control.py b/coverage/control.py index ca3660ac..7c14e1b0 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -772,8 +772,7 @@ class Coverage(object): ) # Find out if we got any data. - summary = self.data.summary() - if not summary and self._warn_no_data: + if not self.data and self._warn_no_data: self._warn("No data was collected.") # Find files that were never executed at all. diff --git a/coverage/data.py b/coverage/data.py index 7b9dd7ea..c9e9a036 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -230,6 +230,11 @@ class CoverageData(object): summ[filename_fn(filename)] = len(lines) return summ + def __nonzero__(self): + return bool(self._lines) or bool(self._arcs) + + __bool__ = __nonzero__ + def has_arcs(self): """Does this data have arcs?""" return bool(self._arcs) |