summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-07-12 09:20:49 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-07-12 09:20:49 -0400
commitf8c89008f9809137edf63e756a1d0d891500b771 (patch)
tree6b266596e9170fd7ee5819923e7ea7cbf62a6e03 /coverage/control.py
parent4bb849f39914138316b33dec2ddb427fb5142b41 (diff)
downloadpython-coveragepy-git-f8c89008f9809137edf63e756a1d0d891500b771.tar.gz
Narrow the amount of code in a coverage start/stop window in a test so that the differences in 2.x and 3.x scoping rules don't change the results of the test. Also, some commented-out logging of the trace machinery that helped me find the problem. Now all tests pass on Python 3.1!
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 b0e7512e..0d19a56c 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -119,6 +119,14 @@ class coverage:
return canonical
+ # To log what should_trace returns, change this to "if 1:"
+ if 0:
+ _real_should_trace = _should_trace
+ def _should_trace(self, filename, frame):
+ ret = self._real_should_trace(filename, frame)
+ print "should_trace: %r -> %r" % (filename, ret)
+ return ret
+
def use_cache(self, usecache):
"""Control the use of a data file (incorrectly called a cache).