diff --git a/lib/matplotlib/testing/decorators.py b/lib/matplotlib/testing/decorators.py
index 6363663..53b276b 100644
--- a/lib/matplotlib/testing/decorators.py
+++ b/lib/matplotlib/testing/decorators.py
@@ -48,42 +48,50 @@ def image_comparison(baseline_images=None):
         raise ValueError('baseline_images must be specified')
     def compare_images_decorator(func):
         def decorated_compare_images(*args,**kwargs):
-            result = func(*args,**kwargs)
-            extension = '.png' # TODO: test more backends
-            for fname in baseline_images:
-                # FIXME: place "actual", or current images, images in
-                # a more reasonable location than the current
-                # directory. Also, perhaps put them in sub-directory
-                # according to the name of the test module like the
-                # baseline images.
-                actual = fname + extension
 
-                # compute filename for baseline image
-                module_name = func.__module__
-                if module_name=='__main__':
-                    # FIXME: this won't work for nested packages in matplotlib.tests
-                    import warnings
-                    warnings.warn('test module run as script. guessing baseline image locations')
-                    script_name = sys.argv[0]
-                    basedir = os.path.abspath(os.path.dirname(script_name))
-                    subdir = os.path.splitext(os.path.split(script_name)[1])[0]
-                else:
-                    mods = module_name.split('.')
-                    assert mods.pop(0)=='matplotlib'
-                    assert mods.pop(0)=='tests'
-                    subdir = os.path.join(*mods)
-                    basedir = os.path.dirname(matplotlib.tests.__file__)
-                baseline_dir = os.path.join(basedir,'baseline_images',subdir)
-                expected = os.path.join(baseline_dir,fname) + extension
+            # compute baseline image directory
+            module_name = func.__module__
+            if module_name=='__main__':
+                # FIXME: this won't work for nested packages in matplotlib.tests
+                import warnings
+                warnings.warn('test module run as script. guessing baseline image locations')
+                script_name = sys.argv[0]
+                basedir = os.path.abspath(os.path.dirname(script_name))
+                subdir = os.path.splitext(os.path.split(script_name)[1])[0]
+            else:
+                mods = module_name.split('.')
+                assert mods.pop(0)=='matplotlib'
+                assert mods.pop(0)=='tests'
+                subdir = os.path.join(*mods)
+                basedir = os.path.dirname(matplotlib.tests.__file__)
+            baseline_dir = os.path.join(basedir,'baseline_images',subdir)
 
-                # compare the images
-                tol=1e-3 # default tolerance
-                err = compare_images( expected, actual, tol,
-                                      in_decorator=True )
-                if err:
-                    raise ImageComparisonFailure(
-                        'images not close: %(actual)s vs. %(expected)s '
-                        '(RMS %(rms).3f)'%err)
-            return result
+            for extension in ['.png', '.pdf']:
+                switch_backends_somehow(extension) # FIXME: implement this
+                last_result = func(*args,**kwargs) # actually call the test function
+                for fname in baseline_images:
+                    # FIXME: place "actual", or current images, images in
+                    # a more reasonable location than the current
+                    # directory. Also, perhaps put them in sub-directory
+                    # according to the name of the test module like the
+                    # baseline images.
+                    actual = fname + extension
+
+                    # compute filename for baseline image
+                    expected = os.path.join(baseline_dir,fname) + extension
+
+                    if extension != '.png':
+                        raise NotImplementedError('No support for comparing '
+                                                  'non .png images yet')
+
+                    # compare the images
+                    tol=1e-3 # default tolerance
+                    err = compare_images( expected, actual, tol,
+                                          in_decorator=True )
+                    if err:
+                        raise ImageComparisonFailure(
+                            'images not close: %(actual)s vs. %(expected)s '
+                            '(RMS %(rms).3f)'%err)
+            return last_result
         return nose.tools.make_decorator(func)(decorated_compare_images)
     return compare_images_decorator
