summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/misc.py9
-rw-r--r--coverage/templite.py1
-rw-r--r--tox.ini7
3 files changed, 15 insertions, 2 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index 875d904a..02fb10ef 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -42,7 +42,7 @@ def format_lines(statements, lines):
lines = sorted(lines)
while i < len(statements) and j < len(lines):
if statements[i] == lines[j]:
- if start == None:
+ if start is None:
start = lines[j]
end = lines[j]
j += 1
@@ -59,7 +59,7 @@ def format_lines(statements, lines):
def short_stack(): # pragma: debugging
"""Return a string summarizing the call stack."""
stack = inspect.stack()[:0:-1]
- return "\n".join("%30s : %s @%d" % (t[3],t[1],t[2]) for t in stack)
+ return "\n".join("%30s : %s @%d" % (t[3], t[1], t[2]) for t in stack)
def expensive(fn):
@@ -69,6 +69,7 @@ def expensive(fn):
"""
attr = "_cache_" + fn.__name__
+
def _wrapped(self):
"""Inner fn that checks the cache."""
if not hasattr(self, attr):
@@ -165,18 +166,22 @@ class CoverageException(Exception):
"""An exception specific to Coverage."""
pass
+
class NoSource(CoverageException):
"""We couldn't find the source for a module."""
pass
+
class NoCode(NoSource):
"""We couldn't find any code at all."""
pass
+
class NotPython(CoverageException):
"""A source file turned out not to be parsable Python."""
pass
+
class ExceptionDuringRun(CoverageException):
"""An exception happened while running customer code.
diff --git a/coverage/templite.py b/coverage/templite.py
index 20b0e504..c102a8f2 100644
--- a/coverage/templite.py
+++ b/coverage/templite.py
@@ -129,6 +129,7 @@ class Templite(object):
code.add_line("to_str = str")
buffered = []
+
def flush_output():
"""Force `buffered` to the code builder."""
if len(buffered) == 1:
diff --git a/tox.ini b/tox.ini
index e51f803a..0a76c318 100644
--- a/tox.ini
+++ b/tox.ini
@@ -40,3 +40,10 @@ basepython = pypy2.4
[testenv:pypy3_24]
basepython = pypy3-2.4
+
+
+# Yes, pep8 will read its settings from tox.ini!
+[pep8]
+# E265: block comment should start with '# '
+# The rest are the default ignored warnings.
+ignore = E265,E123,E133,E226,E241,E242