|
From: <as...@us...> - 2009-09-06 01:42:35
|
Revision: 7642
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7642&view=rev
Author: astraw
Date: 2009-09-06 01:42:27 +0000 (Sun, 06 Sep 2009)
Log Message:
-----------
testing: allow fail_condition to be 'indeterminate' for knownfailureif decorator
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-09-06 01:42:16 UTC (rev 7641)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-09-06 01:42:27 UTC (rev 7642)
@@ -19,7 +19,7 @@
raise KnownFailureTest(msg)
else:
raise
- if fail_condition:
+ if fail_condition and fail_condition != 'indeterminate':
raise KnownFailureDidNotFailTest(msg)
return result
return nose.tools.make_decorator(f)(failer)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-06 01:44:05
|
Revision: 7651
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7651&view=rev
Author: astraw
Date: 2009-09-06 01:43:59 +0000 (Sun, 06 Sep 2009)
Log Message:
-----------
testing: give more informative error when nose plugin not installed
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-09-06 01:43:50 UTC (rev 7650)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-09-06 01:43:59 UTC (rev 7651)
@@ -16,7 +16,7 @@
result = f(*args, **kwargs)
except:
if fail_condition:
- raise KnownFailureTest(msg)
+ raise KnownFailureTest(msg) # An error here when running nose means that you don't have the matplotlib.testing.noseclasses:KnownFailure plugin in use.
else:
raise
if fail_condition and fail_condition != 'indeterminate':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-07 20:56:36
|
Revision: 7702
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7702&view=rev
Author: astraw
Date: 2009-09-07 20:56:27 +0000 (Mon, 07 Sep 2009)
Log Message:
-----------
testing: fix image_comparison decorator to guess image location when test run as script
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-09-07 20:56:17 UTC (rev 7701)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-09-07 20:56:27 UTC (rev 7702)
@@ -55,11 +55,19 @@
# compute filename for baseline image
module_name = func.__module__
- mods = module_name.split('.')
- assert mods.pop(0)=='matplotlib'
- assert mods.pop(0)=='tests'
- subdir = '/'.join(mods)
- basedir = os.path.dirname(matplotlib.tests.__file__)
+ 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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-23 06:24:34
|
Revision: 7816
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7816&view=rev
Author: astraw
Date: 2009-09-23 06:24:27 +0000 (Wed, 23 Sep 2009)
Log Message:
-----------
testing: fix docstring. add comments.
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-09-22 14:21:24 UTC (rev 7815)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-09-23 06:24:27 UTC (rev 7816)
@@ -39,8 +39,8 @@
def image_comparison(baseline_images=None):
"""
compare images generated by the test with those specified in
- *baseline_images*, which must correspond within tolerance *tol*,
- else an ImageComparisonFailure exception will be raised.
+ *baseline_images*, which must correspond else an
+ ImageComparisonFailure exception will be raised.
"""
@@ -51,6 +51,11 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-10-04 18:55:30
|
Revision: 7843
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7843&view=rev
Author: jouni
Date: 2009-10-04 18:55:18 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
@image_comparison now makes a generator that yields a test case for each file format (currently png, pdf)
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-10-03 18:11:09 UTC (rev 7842)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-04 18:55:18 UTC (rev 7843)
@@ -42,66 +42,84 @@
compare images generated by the test with those specified in
*baseline_images*, which must correspond else an
ImageComparisonFailure exception will be raised.
-
"""
if baseline_images is None:
raise ValueError('baseline_images must be specified')
+
+ # The multiple layers of defs are required because of how
+ # parameterized decorators work, and because we want to turn the
+ # single test_foo function to a generator that generates a
+ # separate test case for each file format.
def compare_images_decorator(func):
- def decorated_compare_images(*args,**kwargs):
+ baseline_dir, result_dir = _image_directories(func)
+ # Only run the test if there is a baseline image in the
+ # correct format for comparison.
+ extensions = [ext for ext in ['png', 'pdf']
+ if os.path.exists(os.path.join(
+ baseline_dir, baseline_images[0] + '.' + ext))]
- # 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)
- result_dir = os.path.join(basedir,'current_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)
+ def compare_images_generator():
+ for extension in extensions:
+ @knownfailureif(extension not in comparable_formats(),
+ 'Cannot compare %s files on this system' % extension)
+ def decorated_compare_images():
+ # set the default format of savefig
+ matplotlib.rc('savefig', extension=extension)
+ # change to the result directory for the duration of the test
+ old_dir = os.getcwd()
+ os.chdir(result_dir)
+ try:
+ result = func() # actually call the test function
+ finally:
+ os.chdir(old_dir)
+ for fname in baseline_images:
+ actual = os.path.join(result_dir, fname) + '.' + extension
+ expected = os.path.join(baseline_dir,fname) + '.' + extension
- for extension in ['png', 'pdf']:
- # set the default format of savefig
- matplotlib.rc('savefig', extension=extension)
- # change to the result directory for the duration of the test
- old_dir = os.getcwd()
- os.chdir(result_dir)
- try:
- last_result = func(*args,**kwargs) # actually call the test function
- finally:
- os.chdir(old_dir)
- for fname in baseline_images:
- actual = os.path.join(result_dir, fname) + '.' + extension
- expected = os.path.join(baseline_dir,fname) + '.' + extension
- if (extension not in comparable_formats()
- or not os.path.exists(expected)):
- # FIXME: Should it be a known fail if this format
- # cannot be compared in this environment?
- continue
+ # 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
+ yield (decorated_compare_images,)
+ return nose.tools.make_decorator(func)(compare_images_generator)
+ return compare_images_decorator
- # 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
+def _image_directories(func):
+ """
+ Compute the baseline and result image directories for testing *func*.
+ Create the result directory if it doesn't exist.
+ """
+ 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)
+ result_dir = os.path.join(basedir,'current_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)
+
+ return baseline_dir, result_dir
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-10-06 15:13:50
|
Revision: 7852
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7852&view=rev
Author: astraw
Date: 2009-10-06 15:13:44 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
testing: add trivial comment
(Really this is a test commit to debug the buildbot testing infrastructure.)
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-10-06 15:01:19 UTC (rev 7851)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-06 15:13:44 UTC (rev 7852)
@@ -28,6 +28,7 @@
result = f(*args, **kwargs)
except:
if fail_condition:
+ # (Keep the next ultra-long comment so in shows in console.)
raise KnownFailureTest(msg) # An error here when running nose means that you don't have the matplotlib.testing.noseclasses:KnownFailure plugin in use.
else:
raise
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-10-09 16:10:36
|
Revision: 7860
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7860&view=rev
Author: jouni
Date: 2009-10-09 16:10:28 +0000 (Fri, 09 Oct 2009)
Log Message:
-----------
Don't skip running tests if a baseline image is missing
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-10-09 15:31:59 UTC (rev 7859)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-09 16:10:28 UTC (rev 7860)
@@ -54,11 +54,7 @@
# separate test case for each file format.
def compare_images_decorator(func):
baseline_dir, result_dir = _image_directories(func)
- # Only run the test if there is a baseline image in the
- # correct format for comparison.
- extensions = [ext for ext in ['png', 'pdf']
- if os.path.exists(os.path.join(
- baseline_dir, baseline_images[0] + '.' + ext))]
+ extensions = ['png', 'pdf']
def compare_images_generator():
for extension in extensions:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-10-09 17:20:30
|
Revision: 7862
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7862&view=rev
Author: astraw
Date: 2009-10-09 17:20:23 +0000 (Fri, 09 Oct 2009)
Log Message:
-----------
testing: don't compare images if baseline does not exist
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-10-09 16:32:29 UTC (rev 7861)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-09 17:20:23 UTC (rev 7862)
@@ -4,6 +4,7 @@
import nose
import matplotlib
import matplotlib.tests
+import numpy as np
from matplotlib.testing.compare import comparable_formats, compare_images
def knownfailureif(fail_condition, msg=None):
@@ -58,8 +59,19 @@
def compare_images_generator():
for extension in extensions:
- @knownfailureif(extension not in comparable_formats(),
- 'Cannot compare %s files on this system' % extension)
+ expected_fnames = [os.path.join(baseline_dir,fname) + '.' + extension for fname in baseline_images]
+ 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)
+ is_comparable = extension in comparable_formats()
+ if not is_comparable:
+ fail_msg = 'Cannot compare %s files on this system' % extension
+ elif not have_baseline_image:
+ fail_msg = 'Do not have baseline images %s' % expected_fnames
+ else:
+ fail_msg = 'No failure expected'
+ will_fail = not (is_comparable and have_baseline_image)
+ @knownfailureif(will_fail, fail_msg )
def decorated_compare_images():
# set the default format of savefig
matplotlib.rc('savefig', extension=extension)
@@ -70,9 +82,7 @@
result = func() # actually call the test function
finally:
os.chdir(old_dir)
- for fname in baseline_images:
- actual = os.path.join(result_dir, fname) + '.' + extension
- expected = os.path.join(baseline_dir,fname) + '.' + extension
+ for actual,expected in zip(actual_fnames,expected_fnames):
# compare the images
tol=1e-3 # default tolerance
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-10-09 17:38:56
|
Revision: 7863
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7863&view=rev
Author: astraw
Date: 2009-10-09 17:38:48 +0000 (Fri, 09 Oct 2009)
Log Message:
-----------
testing: allow limiting the extensions to test on image comparison
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-10-09 17:20:23 UTC (rev 7862)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-09 17:38:48 UTC (rev 7863)
@@ -39,23 +39,42 @@
return nose.tools.make_decorator(f)(failer)
return known_fail_decorator
-def image_comparison(baseline_images=None):
+def image_comparison(baseline_images=None,extensions=None):
"""
- compare images generated by the test with those specified in
+ call signature::
+
+ image_comparison(baseline_images=['my_figure'], extensions=None)
+
+ Compare images generated by the test with those specified in
*baseline_images*, which must correspond else an
ImageComparisonFailure exception will be raised.
+
+ Keyword arguments:
+
+ *baseline_images*: list
+ A list of strings specifying the names of the images generated
+ by calls to :meth:`matplotlib.figure.savefig`.
+
+ *extensions*: [ None | list ]
+
+ If *None*, default to all supported extensions.
+
+ Otherwise, a list of extensions to test. For example ['png','pdf'].
"""
if baseline_images is None:
raise ValueError('baseline_images must be specified')
+ if extensions is None:
+ # default extensions to test
+ extensions = ['png', 'pdf']
+
# The multiple layers of defs are required because of how
# parameterized decorators work, and because we want to turn the
# single test_foo function to a generator that generates a
# separate test case for each file format.
def compare_images_decorator(func):
baseline_dir, result_dir = _image_directories(func)
- extensions = ['png', 'pdf']
def compare_images_generator():
for extension in extensions:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-10-11 19:10:38
|
Revision: 7871
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7871&view=rev
Author: astraw
Date: 2009-10-11 19:10:30 +0000 (Sun, 11 Oct 2009)
Log Message:
-----------
testing: allow limiting of known failure to known exception class
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-10-11 19:09:30 UTC (rev 7870)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-11 19:10:30 UTC (rev 7871)
@@ -7,7 +7,7 @@
import numpy as np
from matplotlib.testing.compare import comparable_formats, compare_images
-def knownfailureif(fail_condition, msg=None):
+def knownfailureif(fail_condition, msg=None, known_exception_class=None ):
"""
Assume a will fail if *fail_condition* is True. *fail_condition*
@@ -15,6 +15,9 @@
*msg* is the error message displayed for the test.
+ If *known_exception_class* is not None, the failure is only known
+ if the exception is an instance of this class. (Default = None)
+
"""
# based on numpy.testing.dec.knownfailureif
if msg is None:
@@ -27,8 +30,12 @@
try:
# Always run the test (to generate images).
result = f(*args, **kwargs)
- except:
+ except Exception, err:
if fail_condition:
+ if known_exception_class is not None:
+ if not isinstance(err,known_exception_class):
+ # This is not the expected exception
+ raise
# (Keep the next ultra-long comment so in shows in console.)
raise KnownFailureTest(msg) # An error here when running nose means that you don't have the matplotlib.testing.noseclasses:KnownFailure plugin in use.
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-10-11 19:11:23
|
Revision: 7872
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7872&view=rev
Author: astraw
Date: 2009-10-11 19:11:16 +0000 (Sun, 11 Oct 2009)
Log Message:
-----------
testing: raise errors that are not real known failures on image comparison
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-10-11 19:10:30 UTC (rev 7871)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-11 19:11:16 UTC (rev 7872)
@@ -97,7 +97,8 @@
else:
fail_msg = 'No failure expected'
will_fail = not (is_comparable and have_baseline_image)
- @knownfailureif(will_fail, fail_msg )
+ @knownfailureif(will_fail, fail_msg,
+ known_exception_class=ImageComparisonFailure )
def decorated_compare_images():
# set the default format of savefig
matplotlib.rc('savefig', extension=extension)
@@ -109,6 +110,9 @@
finally:
os.chdir(old_dir)
for actual,expected in zip(actual_fnames,expected_fnames):
+ if not os.path.exists(expected):
+ raise ImageComparisonFailure(
+ 'image does not exist: %s'%expected)
# compare the images
tol=1e-3 # default tolerance
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-11-13 00:44:12
|
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.
|
|
From: <as...@us...> - 2010-02-15 02:02:38
|
Revision: 8130
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8130&view=rev
Author: astraw
Date: 2010-02-15 02:02:32 +0000 (Mon, 15 Feb 2010)
Log Message:
-----------
testing bugfix: always copy baseline image
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/testing/decorators.py
Modified: trunk/matplotlib/lib/matplotlib/testing/decorators.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/testing/decorators.py 2010-02-15 00:19:05 UTC (rev 8129)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2010-02-15 02:02:32 UTC (rev 8130)
@@ -88,8 +88,7 @@
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 os.path.exists(src) and not os.path.exists(dst):
- shutil.copyfile(src,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)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|