Permalink
Browse files

@mdbooms suggestion for handling missing result files.

  • Loading branch information...
1 parent da88271 commit 8952dee3f4bf8113bb6ea95387ba3b4d863c9f8d @pelson committed May 14, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/matplotlib/testing/compare.py
@@ -296,13 +296,14 @@ def compare_images( expected, actual, tol, in_decorator=False ):
# Convert the image to png
extension = expected.split('.')[-1]
- if extension != 'png':
- actual = convert(actual, False)
- expected = convert(expected, True)
if not os.path.exists(expected):
raise IOError('Baseline image %r does not exist.' % expected)
+ if extension != 'png':
+ actual = convert(actual, False)
+ expected = convert(expected, True)
+
# open the image files and remove the alpha channel (if it exists)
expectedImage = _png.read_png_int( expected )
actualImage = _png.read_png_int( actual )

0 comments on commit 8952dee

Please sign in to comment.