summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-16 13:05:50 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-16 13:05:50 -0400
commit25fc9dbdffe6fbbb1b6d555be60b7eba4c80f0a4 (patch)
tree6e92fb97dcb09c1cd73aa0423e5f559a1458ce91 /coverage/html.py
parent7d34df5666dad638b1d9a09f4ad375194a8bc542 (diff)
downloadpython-coveragepy-git-25fc9dbdffe6fbbb1b6d555be60b7eba4c80f0a4.tar.gz
More informative error message if can't find static files
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 6d1bb434..c0dfe80e 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -39,15 +39,22 @@ def data_filename(fname, pkgdir=""):
is provided, at that sub-directory.
"""
+ tried = []
for static_dir in STATIC_PATH:
static_filename = os.path.join(static_dir, fname)
if os.path.exists(static_filename):
return static_filename
+ else:
+ tried.append(static_filename)
if pkgdir:
static_filename = os.path.join(static_dir, pkgdir, fname)
if os.path.exists(static_filename):
return static_filename
- raise CoverageException("Couldn't find static file %r" % fname)
+ else:
+ tried.append(static_filename)
+ raise CoverageException(
+ "Couldn't find static file %r from %r, tried: %r" % (fname, os.getcwd(), tried)
+ )
def data(fname):