summaryrefslogtreecommitdiff
path: root/test/test_farm.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-09-23 22:11:47 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-09-23 22:11:47 -0400
commite44f649ad61d6a7e717931628d2476284402484b (patch)
tree9a70873264cc7832e1156eaac5626f3ff6652408 /test/test_farm.py
parentc0f54c80150b65d650e85339e98c17d025625d24 (diff)
downloadpython-coveragepy-git-e44f649ad61d6a7e717931628d2476284402484b.tar.gz
Get the test working properly, including adding a usable diff comparison when tests fail. Also make it all work under Py3k.
Diffstat (limited to 'test/test_farm.py')
-rw-r--r--test/test_farm.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_farm.py b/test/test_farm.py
index 6200611d..01934dfd 100644
--- a/test/test_farm.py
+++ b/test/test_farm.py
@@ -1,6 +1,6 @@
"""Run tests in the farm subdirectory. Designed for nose."""
-import filecmp, fnmatch, glob, os, shutil, sys
+import difflib, filecmp, fnmatch, glob, os, shutil, sys
sys.path.insert(0, os.path.split(__file__)[0]) # Force relative import for Py3k
from backtest import run_command, execfile # pylint: disable-msg=W0622
@@ -218,10 +218,11 @@ class FarmTestCase(object):
# ourselves.
text_diff = []
for f in diff_files:
- left = open(os.path.join(dir1, f), "r").read()
- right = open(os.path.join(dir2, f), "r").read()
+ left = open(os.path.join(dir1, f), "r").readlines()
+ right = open(os.path.join(dir2, f), "r").readlines()
if left != right:
text_diff.append(f)
+ print("".join(list(difflib.Differ().compare(left, right))))
assert not text_diff, "Files differ: %s" % text_diff
if not left_extra: