From 19ed8718a3a5deb2aaa7d594e7b2a20c516f8e46 Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Sun, 29 Jul 2012 01:47:16 +0200 Subject: [PATCH] Fix test crashes when reference image doesn't exists. Refs #1296 and commit 269569250c5b6535f2fdb3e5116050599ca21c70 --- tests/visual_tests/compare.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/visual_tests/compare.py b/tests/visual_tests/compare.py index 98edde22a..8fa26360e 100644 --- a/tests/visual_tests/compare.py +++ b/tests/visual_tests/compare.py @@ -12,7 +12,6 @@ passed = 0 def compare_pixels(pixel1, pixel2): if pixel1 == pixel2: return False - # will only work on little endian r_diff = abs((pixel1 & 0xff) - (pixel2 & 0xff)) g_diff = abs(((pixel1 >> 8) & 0xff) - ((pixel2 >> 8) & 0xff)) b_diff = abs(((pixel1 >> 16) & 0xff)- ((pixel2 >> 16) & 0xff)) @@ -32,7 +31,7 @@ def compare(actual, expected): im1 = mapnik.Image.open(actual) try: im2 = mapnik.Image.open(expected) - except IOError: + except RuntimeError: errors.append((None, actual, expected)) return -1 diff = 0