From 66ff9b1492e1757b4a4a20573c65185e8f4487a5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 23 Apr 2012 16:13:59 -0700 Subject: [PATCH] show expected image path for visual test failures --- tests/visual_tests/compare.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/visual_tests/compare.py b/tests/visual_tests/compare.py index b558e38ea..ca43c4977 100644 --- a/tests/visual_tests/compare.py +++ b/tests/visual_tests/compare.py @@ -27,13 +27,13 @@ def compare(fn1, fn2): try: im2 = Image.open(fn2) except IOError: - errors.append((fn1, None)) + errors.append((fn1, None, fn2)) return -1 diff = 0 pixels = im1.size[0] * im1.size[1] delta_pixels = im2.size[0] * im2.size[1] - pixels if delta_pixels != 0: - errors.append((fn1, delta_pixels)) + errors.append((fn1, delta_pixels, fn2)) return delta_pixels im1 = im1.getdata() im2 = im2.getdata() @@ -41,7 +41,7 @@ def compare(fn1, fn2): if(compare_pixels(im1[i], im2[i])): diff = diff + 1 if diff != 0: - errors.append((fn1, diff)) + errors.append((fn1, diff, fn2)) passed += 1 return diff @@ -55,7 +55,7 @@ def summary(): if (error[1] is None): print "Could not verify %s: No reference image found!" % error[0] else: - print "%s failed: %d different pixels" % error + print "%s failed: %d different pixels \n\t%s (expected)" % error sys.exit(1) else: print 'All %s tests passed: \x1b[1;32m✓ \x1b[0m' % passed