summaryrefslogtreecommitdiff
path: root/test/test_farm.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-12-20 07:02:12 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-12-20 07:02:12 -0500
commit741e21203b77547906babf0f04edf7eb5dedf723 (patch)
treee6f2350497fad7c57d1aed9e4a47b7db105f0940 /test/test_farm.py
parent3349880afb9409cc052066a8f7688ca5e305693e (diff)
downloadpython-coveragepy-git-741e21203b77547906babf0f04edf7eb5dedf723.tar.gz
Debugging to understand why 'trace function changed' appears.
Diffstat (limited to 'test/test_farm.py')
-rw-r--r--test/test_farm.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test_farm.py b/test/test_farm.py
index 5a2cf8a8..418a3cf5 100644
--- a/test/test_farm.py
+++ b/test/test_farm.py
@@ -7,6 +7,7 @@ sys.path.insert(0, os.path.split(__file__)[0]) # Force relative import for Py3k
from backtest import run_command, execfile # pylint: disable=W0622
from coverage.control import _TEST_NAME_FILE
+from coverage.misc import short_stack
def test_farm(clean_only=False):
@@ -93,7 +94,10 @@ class FarmTestCase(object):
self.cd(cwd)
# Remove any new modules imported during the test run. This lets us
# import the same source files for more than one test.
- for m in [m for m in sys.modules if m not in old_mods]:
+ to_del = [m for m in sys.modules if m not in old_mods]
+ with open(r"\foo\cov.txt", "a") as f:
+ print >>f, ("Deleting modules: %s, %r\n%s" % (self.description, to_del, short_stack()))
+ for m in to_del:
del sys.modules[m]
def run_fully(self): # pragma: not covered