summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-08-20 22:40:00 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-08-20 22:40:00 -0400
commit5d166ad42a5d72fb0e2f4fc0f1e7dca7fbfed5a9 (patch)
tree3ec68e7ba261dadb537d480fc676dd16265f7fdf /coverage/control.py
parent70e12d3bcef0840347181aff5a661b21aaa49f97 (diff)
downloadpython-coveragepy-5d166ad42a5d72fb0e2f4fc0f1e7dca7fbfed5a9.tar.gz
Don't trace code if the reported filename is *.html. Fixes issue #82.
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/coverage/control.py b/coverage/control.py
index b7dfa0a..05a7503 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -198,6 +198,14 @@ class coverage(object):
# can't do anything with the data later anyway.
return False
+ if filename.endswith(".html"):
+ # Jinja and maybe other templating systems compile templates into
+ # Python code, but use the template filename as the filename in
+ # the compiled code. Of course, those filenames are useless later
+ # so don't bother collecting. TODO: How should we really separate
+ # out good file extensions from bad?
+ return False
+
self._check_for_packages()
# Compiled Python files have two filenames: frame.f_code.co_filename is