From f8c89008f9809137edf63e756a1d0d891500b771 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 12 Jul 2009 09:20:49 -0400 Subject: 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! --- coverage/control.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'coverage/control.py') 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). -- cgit v1.2.1