_3Lc @ s d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l
Z d d l m
Z
m Z d d d Z d d d d Z d Z d S( i( t KnownFailureTestt KnownFailureDidNotFailTestt ImageComparisonFailureN( t comparable_formatst compare_imagesc s. d k r d n f d } | S( sD
Assume a will fail if *fail_condition* is True. *fail_condition*
may also be False or the string 'indeterminate'.
*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)
s Test known to failc s: d d l } f d } | j j | S( Nic s y | | } WnO t k
rd } r^ d k rO t | sO qO n t qe n X r d k r t n | S( Nt
indeterminate( t Exceptiont Nonet
isinstanceR R ( t argst kwargst resultt err( t ft fail_conditiont known_exception_classt msg( sP /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/decorators.pyt failer s ( t noset toolst make_decorator( R
R R ( R R R ( R
sP /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/decorators.pyt known_fail_decorator s N( R ( R R R R ( ( R R R sP /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/decorators.pyt knownfailureif
s
gMbP?c sR d k r t d n d k r9 d d d g n f d } | S( sn
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'].
s! baseline_images must be specifiedt pngt pdft svgc sF t \ f d } t j j | S( Nc 3 s x D] g D]# } t j j | d ^ q } g D]'