ó
H`¾Tc           @   sÂ  d  d l  Z  d d l m Z d d l m Z d d l m Z d d l m Z d  d l Z d  d l Z d d „ Z
 d d	 „ Z d
 e f d „  ƒ  YZ d d „ Z d d „ Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ e j Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e d  „  ƒ Z d d! „ Z d" „  Z  d d# „ Z! d d$ „ Z" d d% „ Z# d& „  Z$ d S('   iÿÿÿÿNi   (   t   SkipTesti   (   t	   decorator(   t   config(   t   utilc         C   s,   t  ƒ  } t |  | ƒ } | j j | ƒ | S(   N(   t   compoundt   _as_predicatet   skipst   add(   t	   predicatet   reasont   rulet   pred(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   skip_if   s    	c         C   s,   t  ƒ  } t |  | ƒ } | j j | ƒ | S(   N(   R   R   t   failsR   (   R   R	   R
   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   fails_if   s    	R   c           B   s‰   e  Z d  „  Z d „  Z d „  Z d „  Z e d „  ƒ Z d „  Z d „  Z	 d „  Z
 e j d „  ƒ Z d	 „  Z d
 d „ Z d
 d „ Z RS(   c         C   s   t  ƒ  |  _ t  ƒ  |  _ d  S(   N(   t   setR   R   (   t   self(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   __init__!   s    c         C   s   |  j  | ƒ S(   N(   R   (   R   t   other(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   __add__%   s    c         G   sj   t  ƒ  } | j j |  j ƒ | j j |  j ƒ x4 | D], } | j j | j ƒ | j j | j ƒ q6 W| S(   N(   R   R   t   updateR   (   R   t   otherst   copyR   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   (   s    	c         C   sG   t  ƒ  } | j j d „  |  j Dƒ ƒ | j j d „  |  j Dƒ ƒ | S(   Nc         s   s   |  ] } t  | ƒ Vq d  S(   N(   t   NotPredicate(   t   .0t   fail(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pys	   <genexpr>3   s    c         s   s   |  ] } t  | ƒ Vq d  S(   N(   R   (   R   t   skip(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pys	   <genexpr>4   s    (   R   R   R   R   (   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   not_1   s    	c         C   s   |  j  t j ƒ S(   N(   t   enabled_for_configR   t   _current(   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   enabled7   s    c         C   s8   x1 |  j  j |  j ƒ D] } | | ƒ r t Sq Wt Sd  S(   N(   R   t   unionR   t   Falset   True(   R   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   ;   s    c         C   s;   g  |  j  j |  j ƒ D]! } | | ƒ r | j | ƒ ^ q S(   N(   R   R   R   t
   _as_string(   R   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   matching_config_reasonsB   s    c            s]   t  | d ƒ r  | j ˆ  ƒ | S‡  f d †  } t ‡  f d †  ƒ } | | ƒ } | | _ | S(   Nt   _sa_exclusion_extendc            s*   ˆ  j  j |  j  ƒ ˆ  j j |  j ƒ d  S(   N(   R   R   R   (   R   (   R   (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   extendN   s    c            s   ˆ  j  t j |  | | Ž S(   N(   t   _doR   R   (   t   fnt   argst   kw(   R   (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   decorateR   s    (   t   hasattrR$   R   (   R   R'   R%   R*   t	   decorated(    (   R   sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   __call__I   s    	c         c   sn   t  ƒ  } | j j |  j j |  j ƒ ƒ y	 d  VWn& t k
 rY } | j t j | ƒ n X| j	 t j ƒ d  S(   N(
   R   R   R   R   R   t	   Exceptiont   _expect_failureR   R   t   _expect_success(   R   t	   all_failst   ex(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   fail_ifZ   s    		c   	      O   s«   xH |  j  D]= } | | ƒ r
 d | j | j | ƒ f } t | ƒ ‚ q
 q
 Wy | | | Ž  } Wn, t k
 rŒ } |  j | | d | j ƒn X|  j | d | j ƒ| Sd  S(   Ns	   '%s' : %st   name(   R   t   __name__R"   R    R.   R/   R0   (	   R   R   R'   R(   R)   R   t   msgt   return_valueR2   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR&   f   s    t   blockc         C   sV   xO |  j  D]7 } | | ƒ r
 d | | j | ƒ t | ƒ f GHPq
 q
 Wt j | ƒ d  S(   Ns   %s failed as expected (%s): %s (   R   R"   t   strR   t   raise_from_cause(   R   R   R2   R4   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR/   w   s    c            sg   |  j  s d  SxS |  j  D] } | ˆ  ƒ s Pq q Wt d | d j ‡  f d †  |  j  Dƒ ƒ f ƒ ‚ d  S(   Ns    Unexpected success for '%s' (%s)s    and c         3   s   |  ] } | j  ˆ  ƒ Vq d  S(   N(   R"   (   R   R   (   R   (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pys	   <genexpr>Œ   s   (   R   t   AssertionErrort   join(   R   R   R4   R   (    (   R   sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR0   €   s    	(   R5   t
   __module__R   R   R   R   t   propertyR   R   R#   R-   t
   contextlibt   contextmanagerR3   R&   R/   R0   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR       s   										c         C   s   t  |  ƒ }  t t |  ƒ | ƒ S(   N(   R   R   R   (   R   R	   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   only_if“   s    c         C   s   t  |  ƒ }  t t |  ƒ | ƒ S(   N(   R   R   R   (   R   R	   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   succeeds_if˜   s    t	   Predicatec           B   s5   e  Z e d d  „ ƒ Z e d „ Z d e d „ Z RS(   c         C   s  t  | t ƒ r" |  j | j | ƒ St  | t ƒ rV | rR | j d  k rR | | _ n  | St  | t t f ƒ r” t	 g  | D] } |  j | ƒ ^ qu | ƒ St  | t
 ƒ r­ t | Œ  St  | t j ƒ rI| j d d ƒ } d  } } | j d ƒ } | r| j d ƒ } n  | r3t
 d „  | j d ƒ j d ƒ Dƒ ƒ } n  t | | | d | ƒSt j | ƒ ret | | ƒ St s{t d | ƒ ‚ d  S(   Nt    i   i    c         s   s   |  ] } t  | ƒ Vq d  S(   N(   t   int(   R   t   d(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pys	   <genexpr>³   s    t   .t   descriptions   unknown predicate type: %s(   t
   isinstanceR   t   as_predicateR   RC   RH   t   Nonet   listR   t   OrPredicatet   tuplet   SpecPredicateR   t   string_typest   splitt   popt   callablet   LambdaPredicateR    R;   (   t   clsR   RH   R   t   tokenst   opt   spect   db(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRJ   ž   s0    

+c         C   ss   |  | ƒ } | r | } n  |  j  i | j j j ƒ  d 6| j j j ƒ  d 6| rW d n d d 6| rj d n d d 6S(   Nt   drivert   databases   doesn't supports   does supportt   doesnt_supportt   does_support(   RH   RY   t   urlt   get_driver_namet   get_backend_name(   R   R   t   negatet   bool_(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   _format_descriptionº   s    
	c         C   s   t  ƒ  ‚ d  S(   N(   t   NotImplementedError(   R   R   Ra   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR"   Å   s    N(   R5   R=   t   classmethodRK   RJ   R    Rc   R"   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRC      s   t   BooleanPredicatec           B   s)   e  Z d d  „ Z d „  Z e d „ Z RS(   c         C   s    | |  _  | p d | |  _ d  S(   Ns
   boolean %s(   t   valueRH   (   R   Rg   RH   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   Ê   s    	c         C   s   |  j  S(   N(   Rg   (   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR-   Î   s    c         C   s   |  j  | d | ƒS(   NRa   (   Rc   (   R   R   Ra   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR"   Ñ   s    N(   R5   R=   RK   R   R-   R    R"   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRf   É   s   	RO   c           B   s…   e  Z d d d d  „ Z i e j d 6e j d 6e j d 6e j d 6e j	 d 6e j
 d 6e j d 6d „  d	 6Z d
 „  Z e d „ Z RS(   c         C   s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   RY   RW   RX   RH   (   R   RY   RW   RX   RH   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   Ö   s    			t   <t   >s   ==s   !=s   <=s   >=t   inc         C   s   |  | d k o |  | d k S(   Ni    i   (    (   t   valt   pair(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   <lambda>ä   s    t   betweenc         C   sñ   | j  } d |  j  k r3 |  j  j d ƒ \ } } n |  j  d  } } | r\ | j | k r\ t S| d  k	 r{ | j | k r{ t S|  j d  k	 ré | d  k s¢ t d ƒ ‚ t | ƒ } t	 |  j d ƒ rÉ |  j pÖ |  j
 |  j } | | |  j ƒ St Sd  S(   Nt   +s%   DBAPI version specs not supported yetR-   (   RY   RQ   RK   R4   R    RZ   RW   R;   t   _server_versionR+   t   _opsRX   R!   (   R   R   t   enginet   dialectRZ   t   versiont   oper(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR-   ç   s    	c         C   sˆ   |  j  d  k	 r |  j | ƒ S|  j d  k rJ | r< d |  j Sd |  j Sn: | rj d |  j |  j |  j f Sd |  j |  j |  j f Sd  S(   Ns   not %ss   %ss   not %s %s %ss   %s %s %s(   RH   RK   Rc   RW   RY   RX   (   R   R   Ra   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR"   þ   s    N(   R5   R=   RK   R   t   operatort   ltt   gtt   eqt   net   let   get   containsRq   R-   R    R"   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRO   Õ   s   






	RT   c           B   s/   e  Z d d d d  „ Z d „  Z e d „ Z RS(   c            sŒ   t  j ˆ  ƒ } | d s. ‡  f d †  |  _ n	 ˆ  |  _ | p@ d |  _ | pO i  |  _ | rg | |  _ n! ˆ  j r ˆ  j |  _ n	 d |  _ d  S(   Ni    c            s   ˆ  ƒ  S(   N(    (   RY   (   t   lambda_(    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRm     s    s   custom function(    (   t   inspectt
   getargspecR~   R(   R)   RH   t   __doc__(   R   R~   RH   R(   R)   RX   (    (   R~   sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR     s    
		c         C   s   |  j  | ƒ S(   N(   R~   (   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR-   %  s    c         C   s   |  j  | ƒ S(   N(   Rc   (   R   R   Ra   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR"   (  s    N(   R5   R=   RK   R   R-   R    R"   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRT     s   	R   c           B   s)   e  Z d d  „ Z d „  Z e d „ Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   R   RH   (   R   R   RH   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   -  s    	c         C   s   |  j  | ƒ S(   N(   R   (   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR-   1  s    c         C   s2   |  j  r |  j | | ƒ S|  j j | | ƒ Sd  S(   N(   RH   Rc   R   R"   (   R   R   Ra   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR"   4  s    	N(   R5   R=   RK   R   R-   R    R"   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   ,  s   	RM   c           B   s>   e  Z d d  „ Z d „  Z e d „ Z d „  Z e d „ Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t
   predicatesRH   (   R   R‚   RH   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   <  s    	c         C   s(   x! |  j  D] } | | ƒ r
 t Sq
 Wt S(   N(   R‚   R!   R    (   R   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR-   @  s    c            s8   ˆ  r d } n d } | j  ‡ ‡  f d †  |  j Dƒ ƒ S(   Ns    and s    or c         3   s$   |  ] } | j  ˆ  d  ˆ ƒVq d S(   Ra   N(   R"   (   R   t   p(   R   Ra   (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pys	   <genexpr>K  s   (   R<   R‚   (   R   R   Ra   t   conjunction(    (   Ra   R   sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt	   _eval_strF  s
    	c         C   s7   |  j  d  k	 r  d |  j | ƒ S|  j | d t ƒSd  S(   Ns   Not Ra   (   RH   RK   Rc   R…   R!   (   R   R   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   _negation_strN  s    c         C   s@   | r |  j  | ƒ S|  j d  k	 r/ |  j | ƒ S|  j | ƒ Sd  S(   N(   R†   RH   RK   Rc   R…   (   R   R   Ra   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR"   T  s
    N(	   R5   R=   RK   R   R-   R    R…   R†   R"   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRM   ;  s
   		c         C   s   t  |  | | ƒ t j ƒ S(   N(   RO   R   R   (   RY   RW   RX   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   _is_excludeda  s    c         C   s/   |  j  ƒ  } t |  j d d ƒ } | j ƒ  | S(   s#   Return a server_version_info tuple.t   server_version_info(    (   t   connectt   getattrRs   t   close(   Rr   t   connRt   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyRp   e  s    
c          G   s&   t  g  |  D] } t j | ƒ ^ q
 ƒ S(   N(   RM   RC   RJ   (   t   dbsRY   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   db_speco  s    c           C   s   t  t t d ƒ ƒ S(   Ns   mark as execute(   R   Rf   R    (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   openu  s    c           C   s   t  t t d ƒ ƒ S(   Ns   marked as skip(   R   Rf   R!   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   closedy  s    c           C   s   t  t t d ƒ ƒ S(   Ns   expected to fail(   R   Rf   R!   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   }  s    c         G   s   t  t |  ƒ d ƒ S(   Ns   Future feature(   R   RT   (   R'   t   arg(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   future  s    c         C   s   t  t |  ƒ | ƒ S(   N(   R   RO   (   RY   R	   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   fails_on†  s    c          G   s)   t  t g  |  D] } t | ƒ ^ q ƒ ƒ S(   N(   RB   RM   RO   (   R   RY   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   fails_on_everything_exceptŠ  s    c         C   s   t  t |  ƒ | ƒ S(   N(   R   RO   (   RY   R	   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyR   ’  s    c         C   s2   t  t g  t j |  ƒ D] } t | ƒ ^ q ƒ ƒ S(   N(   RA   RM   R   t   to_listRO   (   R   R	   RY   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   only_on–  s    c         C   s   t  t |  | | ƒ | ƒ S(   N(   R   RO   (   RY   RW   RX   R	   (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   excludeœ  s    c         G   s>   | s t  d ƒ ‚ t g  | D] } t j | ƒ ^ q ƒ |  ƒ S(   Ns   no queries sent!(   R;   RM   RC   RJ   (   R   t   queriest   query(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   against   s
    (%   Rv   t   plugin.plugin_baseR    R   R   t    R   R   R?   RK   R   R   t   objectR   RA   RB   RC   Rf   RO   RT   R   RM   RJ   R   R‡   Rp   RŽ   R   R   R   R’   R“   R”   R   R–   R—   Rš   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.pyt   <module>	   s>   s,@#			
					