summaryrefslogtreecommitdiff
path: root/coverage/data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-01-21 18:04:22 -0500
committerNed Batchelder <ned@nedbatchelder.com>2018-01-21 18:04:22 -0500
commitd9462bb69b9b96ff41a316322b9e3826061bc9ab (patch)
tree002cd985c6cc373363f272827c02c2d9c8083aa0 /coverage/data.py
parente756776c0a9f3c78389bcc93e067ac3ac0f45ad9 (diff)
downloadpython-coveragepy-git-d9462bb69b9b96ff41a316322b9e3826061bc9ab.tar.gz
Raise an error if combine can't find usable data files. #629
Diffstat (limited to 'coverage/data.py')
-rw-r--r--coverage/data.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/coverage/data.py b/coverage/data.py
index ecfb86b9..6f76a727 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -722,6 +722,7 @@ class CoverageDataFiles(object):
if strict and not files_to_combine:
raise CoverageException("No data to combine")
+ files_combined = 0
for f in files_to_combine:
new_data = CoverageData(debug=self.debug)
try:
@@ -733,10 +734,14 @@ class CoverageDataFiles(object):
self.warn(str(exc))
else:
data.update(new_data, aliases=aliases)
+ files_combined += 1
if self.debug and self.debug.should('dataio'):
self.debug.write("Deleting combined data file %r" % (f,))
file_be_gone(f)
+ if strict and not files_combined:
+ raise CoverageException("No usable data files")
+
def canonicalize_json_data(data):
"""Canonicalize our JSON data so it can be compared."""