Revision: 7962
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7962&view=rev
Author:   astraw
Date:     2009-11-13 00:44:03 +0000 (Fri, 13 Nov 2009)

Log Message:
-----------
testing bugfix: don't save test results to site-packages

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/testing/decorators.py

Modified: trunk/matplotlib/lib/matplotlib/testing/decorators.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/testing/decorators.py       2009-11-12 
23:07:36 UTC (rev 7961)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py       2009-11-13 
00:44:03 UTC (rev 7962)
@@ -1,6 +1,6 @@
 from matplotlib.testing.noseclasses import KnownFailureTest, \
      KnownFailureDidNotFailTest, ImageComparisonFailure
-import os, sys
+import os, sys, shutil
 import nose
 import matplotlib
 import matplotlib.tests
@@ -85,7 +85,11 @@
 
         def compare_images_generator():
             for extension in extensions:
-                expected_fnames = [os.path.join(baseline_dir,fname) + '.' + 
extension for fname in baseline_images]
+                orig_expected_fnames = [os.path.join(baseline_dir,fname) + '.' 
+ extension for fname in baseline_images]
+                expected_fnames = [os.path.join(result_dir,'expected-'+fname) 
+ '.' + extension for fname in baseline_images]
+                for src,dst in zip( orig_expected_fnames, expected_fnames ):
+                    if not os.path.exists(dst):
+                        shutil.copyfile(src,dst)
                 actual_fnames = [os.path.join(result_dir, fname) + '.' + 
extension for fname in baseline_images]
                 have_baseline_images = [os.path.exists(expected) for expected 
in expected_fnames]
                 have_baseline_image = np.all(have_baseline_images)
@@ -148,15 +152,10 @@
         basedir = os.path.dirname(matplotlib.tests.__file__)
 
     baseline_dir = os.path.join(basedir,'baseline_images',subdir)
-    result_dir = os.path.join(basedir,'current_images',subdir)
+    result_dir = os.path.abspath(os.path.join('result_images',subdir))
 
     if not os.path.exists(result_dir):
-        try:
-            # make the current_images directory first
-            os.mkdir(os.path.join(basedir,'current_images'))
-        except OSError:
-            pass # probably exists already
-        os.mkdir(result_dir)
+        os.makedirs(result_dir)
 
     return baseline_dir, result_dir
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to