
b]c           @   sb   d  Z  d d l Z d d l m Z d d l m Z d e f d     YZ d	 e f d
     YZ d S(   s   Global database feature support policy.

Provides decorators to mark tests requiring specific feature support from the
target database.

External dialect test suites should subclass SuiteRequirements
to provide specific inclusion/exclusions.

iNi   (   t
   exclusionsi   (   t   utilt   Requirementsc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR      s   t   SuiteRequirementsc           B   s  e  Z e d     Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z	 e d    Z
 e d    Z e d	    Z e d
    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z e d    Z  e d    Z! e d    Z" e d     Z# e d!    Z$ e d"    Z% e d#    Z& e d$    Z' e d%    Z( e d&    Z) e d'    Z* e d(    Z+ e d)    Z, e d*    Z- e d+    Z. e d,    Z/ e d-    Z0 e d.    Z1 e d/    Z2 e d0    Z3 e d1    Z4 e d2    Z5 e d3    Z6 e d4    Z7 e d5    Z8 e d6    Z9 e d7    Z: e d8    Z; e d9    Z< e d:    Z= e d;    Z> e d<    Z? e d=    Z@ e d>    ZA e d?    ZB e d@    ZC e dA    ZD e dB    ZE e dC    ZF e dD    ZG e dE    ZH e dF    ZI e dG    ZJ e dH    ZK e dI    ZL e dJ    ZM e dK    ZN e dL    ZO e dM    ZP e dN    ZQ e dO    ZR e dP    ZS e dQ    ZT e dR    ZU e dS    ZV e dT    ZW e dU    ZX e dV    ZY e dW    ZZ e dX    Z[ e dY    Z\ e dZ    Z] e d[    Z^ e d\    Z_ e d]    Z` e d^    Za e d_    Zb e d`    Zc e da    Zd e db    Ze e dc    Zf e dd    Zg e de    Zh e df    Zi e dg    Zj e dh    Zk e di    Zl e dj    Zm e dk    Zn e dl    Zo e dm    Zp e dn    Zq e do    Zr e dp    Zs dq   Zt e dr    Zu e ds    Zv e dt    Zw e du    Zx e dv    Zy e dw    Zz e dx    Z{ e dy    Z| e dz    Z} e d{    Z~ e d|    Z e d}    Z e d~    Z e d    Z d   Z d   Z e d    Z e d    Z d   Z d   Z RS(   c         C   s
   t  j   S(   s/   target platform can emit basic CreateTable DDL.(   R    t   open(   t   self(    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   create_table   s    c         C   s
   t  j   S(   s-   target platform can emit basic DropTable DDL.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt
   drop_table#   s    c         C   s
   t  j   S(   s*   Target database must support foreign keys.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   foreign_keys)   s    c         C   s
   t  j   S(   sR   "target database must support ON UPDATE..CASCADE behavior in
        foreign keys.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   on_update_cascade/   s    c         C   s
   t  j   S(   sW   target database must *not* support ON UPDATE..CASCADE behavior in
        foreign keys.(   R    t   closed(   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   non_updating_cascade6   s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   deferrable_fks<   s    c            s   t  j   f d    S(   Nc              s     j  j p   j j S(   N(   R   t   enabledR   (    (   R   (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   <lambda>F   s   (   R    t   only_if(   R   (    (   R   s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   on_update_or_deferrable_fks@   s    c         C   s
   t  j   S(   s;   Target database must support self-referential foreign keys.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   self_referential_foreign_keysJ   s    c         C   s
   t  j   S(   s=   Target database must support the DDL phrases for FOREIGN KEY.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   foreign_key_ddlP   s    c         C   s
   t  j   S(   s3   target database must support names for constraints.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   named_constraintsV   s    c         C   s
   t  j   S(   s(   Target database must support subqueries.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt
   subqueries\   s    c         C   s
   t  j   S(   sR   target database can render OFFSET, or an equivalent, in a
        SELECT.
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   offsetb   s    c         C   s
   t  j   S(   sW   target database can render LIMIT and/or OFFSET using a bound
        parameter
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   bound_limit_offsetj   s    c         C   s
   t  j   S(   s   target database can render LIMIT and/or OFFSET with a complete
        SQL expression, such as one that uses the addition operator.
        parameter
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   sql_expression_limit_offsetr   s    c         C   s
   t  j   S(   s   Target database must support parenthesized SELECT in UNION
        when LIMIT/OFFSET is specifically present.

        E.g. (SELECT ...) UNION (SELECT ..)

        This is known to fail on SQLite.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt/   parens_in_union_contained_select_w_limit_offset{   s    
c         C   s
   t  j   S(   sl  Target database must support parenthesized SELECT in UNION
        when OFFSET/LIMIT is specifically not present.

        E.g. (SELECT ... LIMIT ..) UNION (SELECT .. OFFSET ..)

        This is known to fail on SQLite.  It also fails on Oracle
        because without LIMIT/OFFSET, there is currently no step that
        creates an additional subquery.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt0   parens_in_union_contained_select_wo_limit_offset   s    c         C   s
   t  j   S(   s;   Target database must support boolean expressions as columns(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   boolean_col_expressions   s    c         C   s
   t  j   S(   s5   Target database allows boolean columns to store NULL.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   nullable_booleans   s    c         C   s
   t  j   S(   s,   Target backends that support nulls ordering.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   nullsordering   s    c         C   s
   t  j   S(   s   target database/driver supports bound parameters as column expressions
        without being in the context of a typed column.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   standalone_binds   s    c         C   s
   t  j   S(   s   target database/driver supports bound parameters with NULL in the
        WHERE clause, in situations where it has to be typed.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt!   standalone_null_binds_whereclause   s    c         C   s
   t  j   S(   s5   Target database must support INTERSECT or equivalent.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt	   intersect   s    c         C   s
   t  j   S(   s?   Target database must support EXCEPT or equivalent (i.e. MINUS).(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   except_   s    c         C   s
   t  j   S(   s.   Target database must support window functions.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   window_functions   s    c         C   s
   t  j   S(   s   Target database supports CTEs(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   ctes   s    c         C   s
   t  j   S(   s   target database supports CTES that ride on top of a normal UPDATE
        or DELETE statement which refers to the CTE in a correlated subquery.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   ctes_with_update_delete   s    c         C   s
   t  j   S(   s}   target database supports CTES which consist of INSERT, UPDATE
        or DELETE *within* the CTE, e.g. WITH x AS (UPDATE....)(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   ctes_on_dml   s    c         C   s
   t  j   S(   s~   target platform generates new surrogate integer primary key values
        when insert() is executed, excluding the pk column.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   autoincrement_insert   s    c         C   s
   t  j   S(   s#  target platform will allow cursor.fetchone() to proceed after a
        COMMIT.

        Typically this refers to an INSERT statement with RETURNING which
        is invoked within "autocommit".   If the row can be returned
        after the autocommit, then this rule can be open.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   fetch_rows_post_commit   s    c         C   s
   t  j   S(   s   target platform supports SQL expressions in GROUP BY

        e.g.

        SELECT x + y AS somelabel FROM table GROUP BY x + y

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   group_by_complex_expression   s    
c         C   s   t  j d   d  S(   Nc         S   s   |  j  j j S(   N(   t   dbt   dialectt   supports_sane_rowcount(   t   config(    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR      t    s&   driver doesn't support 'sane' rowcount(   R    t   skip_if(   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   sane_rowcount   s    c         C   s   t  j d   d  S(   Nc         S   s   |  j  j j S(   N(   R*   R+   t   supports_sane_multi_rowcount(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s;   driver %(driver)s %(doesnt_support)s 'sane' multi row count(   R    t   fails_if(   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   sane_multi_rowcount  s    c         C   s   t  j d   d  S(   Nc         S   s   |  j  j j S(   N(   R*   R+   t    supports_sane_rowcount_returning(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s    s;   driver doesn't support 'sane' rowcount when returning is on(   R    R2   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   sane_rowcount_w_returning
  s    c         C   s   t  j d   d  S(   sa   target platform supports INSERT with no values, i.e.
        INSERT DEFAULT VALUES or equivalent.c         S   s   |  j  j j p |  j  j j S(   N(   R*   R+   t   supports_empty_insertt   supports_default_values(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s   s   empty inserts not supported(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   empty_inserts  s    c         C   s
   t  j   S(   s.   target platform supports INSERT from a SELECT.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   insert_from_select  s    c         C   s   t  j d   d  S(   s#   target platform supports RETURNING.c         S   s   |  j  j j S(   N(   R*   R+   t   implicit_returning(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR   )  R.   s)   %(database)s %(does_support)s 'returning'(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt	   returning$  s    c         C   s
   t  j   S(   sZ   Target platform supports the syntax
        "(x, y) IN ((x1, y1), (x2, y2), ...)"
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   tuple_in-  s    c         C   s
   t  j   S(   sw   target platform supports a SELECT statement that has
        the same name repeated more than once in the columns list.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt%   duplicate_names_in_cursor_description5  s    c         C   s   t  j d   d  S(   s[   Target database must have 'denormalized', i.e.
        UPPERCASE as case insensitive names.c         S   s   |  j  j j S(   N(   R*   R+   t   requires_name_normalize(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR   B  R.   s,   Backend does not require denormalized names.(   R    R/   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   denormalized_names<  s    c         C   s   t  j d   d  S(   sT   target database must support multiple VALUES clauses in an
        INSERT statement.c         S   s   |  j  j j S(   N(   R*   R+   t   supports_multivalues_insert(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR   L  R.   s*   Backend does not support multirow inserts.(   R    R/   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   multivalues_insertsF  s    c         C   s
   t  j   S(   sw   "target dialect implements the executioncontext.get_lastrowid()
        method without reliance on RETURNING.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   implements_get_lastrowidP  s    c         C   s
   t  j   S(   s=  "target dialect retrieves cursor.lastrowid, or fetches
        from a database-side function after an insert() construct executes,
        within the get_lastrowid() method.

        Only dialects that "pre-execute", or need RETURNING to get last
        inserted id, would return closed/fail/skip for this.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   emulated_lastrowidX  s    
c         C   s
   t  j   S(   s^   "target platform includes a 'lastrowid' accessor on the DBAPI
        cursor object.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   dbapi_lastrowidd  s    c         C   s
   t  j   S(   s#   Target database must support VIEWs.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   viewsl  s    c         C   s
   t  j   S(   sX   Target database must support external schemas, and have one
        named 'test_schema'.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   schemasr  s    c         C   s
   t  j   S(   sL   target system must support reflection of inter-schema foreign keys

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   cross_schema_fk_reflectiony  s    c         C   s
   t  j   S(   s   target system has a strong concept of 'default' schema that can
           be referred to implicitly.

           basically, PostgreSQL.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   implicit_default_schema  s    c         C   s   t  j d   g d  S(   s0   Target dialect must support server side cursors.c         S   s   |  j  j j S(   N(   R*   R+   t   supports_server_side_cursors(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s   no server side cursors support(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   server_side_cursors  s    	c         C   s   t  j d   g d  S(   s'   Target database must support SEQUENCEs.c         S   s   |  j  j j S(   N(   R*   R+   t   supports_sequences(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s   no sequence support(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt	   sequences  s    	c         C   s   t  j d   g d  S(   sg   Target database supports sequences, but also optionally
        as a means of generating new PK values.c         S   s   |  j  j j o |  j  j j S(   N(   R*   R+   RK   t   sequences_optional(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s   s.   no sequence support, or sequences not optional(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyRM     s    	c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   reflects_pk_names  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   table_reflection  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   comment_reflection  s    c         C   s   |  j  S(   s   target database must support retrieval of the columns in a view,
        similarly to how a table is inspected.

        This does not include the full CREATE VIEW definition.

        (   RE   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   view_column_reflection  s    c         C   s   |  j  S(   sT   target database must support inspection of the full CREATE VIEW definition.
        (   RE   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   view_reflection  s    c         C   s   |  j  S(   N(   RF   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   schema_reflection  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt!   primary_key_constraint_reflection  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt!   foreign_key_constraint_reflection  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt1   foreign_key_constraint_option_reflection_ondelete  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt1   foreign_key_constraint_option_reflection_onupdate  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   temp_table_reflection  s    c         C   s
   t  j   S(   s8   target dialect supports listing of temporary table names(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   temp_table_names  s    c         C   s
   t  j   S(   s)   target database supports temporary tables(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   temporary_tables  s    c         C   s
   t  j   S(   s(   target database supports temporary views(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   temporary_views  s    c         C   s
   t  j   S(   N(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   index_reflection  s    c         C   s
   t  j   S(   s>   target database supports CREATE INDEX against SQL expressions.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   indexes_with_expressions  s    c         C   s
   t  j   S(   s8   target dialect supports reflection of unique constraints(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   unique_constraint_reflection  s    c         C   s
   t  j   S(   s7   target dialect supports reflection of check constraints(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   check_constraint_reflection  s    c         C   s
   t  j   S(   s   target dialect raises IntegrityError when reporting an INSERT
        with a primary key violation.  (hint: it should)

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt$   duplicate_key_raises_integrity_error  s    c         C   s
   t  j   S(   s3   Target database must support VARCHAR with no length(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   unbounded_varchar  s    c         C   s
   t  j   S(   s   Target database/dialect must support Python unicode objects with
        non-ASCII characters represented, delivered as bound parameters
        as well as in result rows.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   unicode_data  s    c         C   s
   t  j   S(   sR   Target driver must support some degree of non-ascii symbol
        names.
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   unicode_ddl  s    c         C   s
   t  j   S(   s   target dialect supports rendering of a date, time, or datetime as a
        literal string, e.g. via the TypeEngine.literal_processor() method.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   datetime_literals  s    c         C   s
   t  j   S(   sU   target dialect supports representation of Python
        datetime.datetime() objects.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   datetime&  s    c         C   s
   t  j   S(   sf   target dialect supports representation of Python
        datetime.datetime() with microsecond objects.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   datetime_microseconds-  s    c         C   s
   t  j   S(   s   target dialect supports representation of Python
        datetime.datetime() with microsecond objects but only
        if TIMESTAMP is used.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   timestamp_microseconds4  s    c         C   s
   t  j   S(   su   target dialect supports representation of Python
        datetime.datetime() objects with historic (pre 1970) values.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   datetime_historic;  s    c         C   s
   t  j   S(   sQ   target dialect supports representation of Python
        datetime.date() objects.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   dateB  s    c         C   s
   t  j   S(   sP   target dialect accepts a datetime object as the target
        of a date column.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   date_coerces_from_datetimeI  s    c         C   s
   t  j   S(   su   target dialect supports representation of Python
        datetime.datetime() objects with historic (pre 1970) values.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   date_historicP  s    c         C   s
   t  j   S(   sQ   target dialect supports representation of Python
        datetime.time() objects.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   timeW  s    c         C   s
   t  j   S(   sb   target dialect supports representation of Python
        datetime.time() with microsecond objects.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   time_microseconds^  s    c         C   s
   t  j   S(   st   target database/driver can allow BLOB/BINARY fields to be compared
        against a bound parameter value.
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   binary_comparisonse  s    c         C   s
   t  j   S(   s!  target backend supports simple binary literals, e.g. an
        expression like::

            SELECT CAST('foo' AS BINARY)

        Where ``BINARY`` is the type emitted from :class:`.LargeBinary`,
        e.g. it could be ``BLOB`` or similar.

        Basically fails on Oracle.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   binary_literalsm  s    c         C   s
   t  j   S(   s:   target dialect supports 'AUTOCOMMIT' as an isolation_level(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt
   autocommit}  s    c         C   s
   t  j   S(   s.   target platform implements a native JSON type.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt	   json_type  s    c         C   s   |  j  S(   sO   "target platform supports numeric array indexes
        within a JSON structure(   Rq   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   json_array_indexes  s    c         C   s
   t  j   S(   sR   target backend has general support for moderately high-precision
        numerics.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   precision_numerics_general  s    c         C   s
   t  j   S(   sb   target backend supports Decimal() objects using E notation
        to represent very small values.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt"   precision_numerics_enotation_small  s    c         C   s
   t  j   S(   sb   target backend supports Decimal() objects using E notation
        to represent very large values.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt"   precision_numerics_enotation_large  s    c         C   s
   t  j   S(   s   target backend supports values with many digits on both sides,
        such as 319438950232418390.273596, 87673.594069654243

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt*   precision_numerics_many_significant_digits  s    c         C   s
   t  j   S(   s-  target backend will return a selected Decimal as a Decimal, not
        a string.

        e.g.::

            expr = decimal.Decimal("15.7563")

            value = e.scalar(
                select([literal(expr)])
            )

            assert value == expr

        See :ticket:`4036`

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   implicit_decimal_binds  s    c         C   s
   t  j   S(   sh   target database can select an aggregate from a subquery that's
        also using an aggregate

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   nested_aggregates  s    c         C   s
   t  j   S(   sb   target database must support ON DELETE CASCADE on a self-referential
        foreign key

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   recursive_fk_cascade  s    c         C   s
   t  j   S(   s   A precision numeric type will return empty significant digits,
        i.e. a value such as 10.000 will come back in Decimal form with
        the .000 maintained.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt-   precision_numerics_retains_significant_digits  s    c         C   s
   t  j   S(   s   target backend will return native floating point numbers with at
        least seven decimal places when using the generic Float type.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   precision_generic_float_type  s    c         C   s
   t  j   S(   s   target backend can return a floating-point number with four
        significant digits (such as 15.7563) accurately
        (i.e. without FP inaccuracies, such as 15.75629997253418).

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   floats_to_four_decimals  s    c         C   s
   t  j   S(   s   target backend doesn't crash when you try to select a NUMERIC
        value that has a value of NULL.

        Added to support Pyodbc bug #351.
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   fetch_null_from_numeric  s    c         C   s
   t  j   S(   sU   Target database must support an unbounded Text() "
        "type such as TEXT or CLOB(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt	   text_type  s    c         C   s
   t  j   S(   sT   target database can persist/return an empty string with a
        varchar.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   empty_strings_varchar  s    c         C   s
   t  j   S(   sR   target database can persist/return an empty string with an
        unbounded text.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   empty_strings_text   s    c         C   s
   t  j   S(   sU   target database supports use of an unbounded textual field in a
        WHERE clause.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt"   expressions_against_unbounded_text  s    c         C   s
   t  j   S(   s;   target driver must support the literal statement 'select 1'(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt	   selectone  s    c         C   s
   t  j   S(   s(   Target database must support savepoints.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt
   savepoints  s    c         C   s
   t  j   S(   s4   Target database must support two-phase transactions.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   two_phase_transactions  s    c         C   s
   t  j   S(   s'   Target must support UPDATE..FROM syntax(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   update_from  s    c         C   s
   t  j   S(   s=   Target must support DELETE FROM..FROM or DELETE..USING syntax(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   delete_from$  s    c         C   s
   t  j   S(   s  Target must support UPDATE (or DELETE) where the same table is
        present in a subquery in the WHERE clause.

        This is an ANSI-standard syntax that apparently MySQL can't handle,
        such as::

            UPDATE documents SET flag=1 WHERE documents.title IN
                (SELECT max(documents.title) AS title
                    FROM documents GROUP BY documents.user_id
                )

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   update_where_target_in_subquery)  s    c         C   s
   t  j   S(   sO   target database must use a plain percent '%' as the 'modulus'
        operator.(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   mod_operator_as_percent_sign9  s    c         C   s
   t  j   S(   s  target backend supports weird identifiers with percent signs
        in them, e.g. 'some % column'.

        this is a very weird use case but often has problems because of
        DBAPIs that use python formatting.  It's not a critical use
        case either.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   percent_schema_names?  s    
c         C   s
   t  j   S(   s   target database supports ordering by a column from a SELECT
        inside of a UNION

        E.g.  (SELECT id, ...) UNION (SELECT id, ...) ORDER BY id

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   order_by_col_from_unionK  s    c         C   s
   t  j   S(   s  target backend supports ORDER BY a column label within an
        expression.

        Basically this::

            select data as foo from test order by foo || 'bar'

        Lots of databases including PostgreSQL don't support this,
        so this is off by default.

        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   order_by_label_with_expressionU  s    c            s     f d   } t  j |  S(   Nc            s.   y   j  |   t SWn t k
 r) t SXd  S(   N(   t   get_order_by_collationt   Falset   NotImplementedErrort   True(   R-   (   R   (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   checkf  s
    (   R    R/   (   R   R   (    (   R   s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   order_by_collationd  s    c         C   s   t     d  S(   N(   R   (   R   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR   o  s    c         C   s
   t  j   S(   sU   Target driver must support non-ASCII characters being passed at
        all.
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   unicode_connectionsr  s    c         C   s
   t  j   S(   s   Target driver must raise a DBAPI-level exception, such as
        InterfaceError, when the underlying connection has been closed
        and the execute() method is called.
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   graceful_disconnectsy  s    c         C   s
   t  j   S(   sU   
        Target must support simultaneous, independent database connections.
        (   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   independent_connections  s    c         C   s
   t  j   S(   s9   Catchall for a large variety of MySQL on Windows failures(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   skip_mysql_on_windows  s    c         C   s   t  j d    S(   s   Test environment must allow ad-hoc engine/connection creation.

        DBs that scale poorly for many connections, even when closed, i.e.
        Oracle, may use the "--low-connections" option which flags this
        requirement as not present.

        c         S   s
   |  j  j S(   N(   t   optionst   low_connections(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   (   R    R/   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   ad_hoc_engines  s    	c         C   s   t  j d  S(   Nt   timing_intensive(   R    t   requires_tag(   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s    c         C   s   t  j d  S(   Nt   memory_intensive(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s    c         C   s   t  j d   d  S(   s   Mark tests that use threading and mock at the same time - stability
        issues have been observed with coverage + python 3.3

        c         S   s   t  j o |  j j S(   N(   R   t   py3kR   t   has_coverage(   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s%   Stability issues with coverage + py3k(   R    R/   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   threading_with_mock  s    c         C   s   t  j d   d  S(   Nc           S   s   t  j d k S(   Ni   (   i   (   t   syst   version_info(    (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s    Python version 2.xx is required.(   R    R/   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   python2  s    c         C   s   t  j d   d  S(   Nc           S   s   t  j d k  S(   Ni   (   i   (   R   R   (    (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s    Python version 3.xx is required.(   R    R/   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   python3  s    c         C   s   t  j d   d  S(   Nc           S   s   t  j S(   N(   R   t   cpython(    (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s   cPython interpreter needed(   R    R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s    c            s)   d d l  m   t j   f d   d  S(   Ni(   t   picklec              s&   t  j r   j d k p% t j d k S(   Nt   cPicklei   i   (   i   i   (   R   t   pypyR   R   R   (    (   R   (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s   
s.   Needs cPickle+cPython or newer Python 3 pickle(   t   sqlalchemy.utilR   R    R   (   R   (    (   R   s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   non_broken_pickle  s    c         C   s   |  j  S(   s   target platform must remove all cycles unconditionally when
        gc.collect() is called, as well as clean out unreferenced subclasses.

        (   R   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   predictable_gc  s    c         C   s   t  j d   d  S(   s   Test should be skipped if coverage is enabled.

        This is to block tests that exercise libraries that seem to be
        sensitive to coverage, such as PostgreSQL notice logging.

        c         S   s
   |  j  j S(   N(   R   R   (   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s(   Issues observed when coverage is enabled(   R    R/   (   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   no_coverage  s    c         C   s   t  S(   N(   R   (   R   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   _has_mysql_on_windows  s    c         C   s   t  S(   N(   R   (   R   R-   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   _has_mysql_fully_case_sensitive  s    c            s   t  j   f d    S(   Nc              s     j    S(   N(   t   _has_sqlite(    (   R   (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   (   R    R/   (   R   (    (   R   s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   sqlite  s    c            s   t  j   f d   d  S(   Nc              s     j    S(   N(   t   _has_cextensions(    (   R   (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     R.   s   C extensions not installed(   R    R/   (   R   (    (   R   s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   cextensions  s    c         C   s;   d d l  m } y | d  t SWn t k
 r6 t SXd  S(   Ni(   t   create_engines	   sqlite://(   t
   sqlalchemyR   R   t   ImportErrorR   (   R   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s    
c         C   s7   y d d l  m } m } t SWn t k
 r2 t SXd  S(   Ni(   t   cresultproxyt   cprocessors(   R   R   R   R   R   R   (   R   R   R   (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR     s
    (   R   R   t   propertyR   R	   R
   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   R0   R3   R5   R8   R9   R;   R<   R=   R?   RA   RB   RC   RD   RE   RF   RG   RH   RJ   RL   RM   RN   RO   RP   RQ   RR   RS   RT   RU   RV   RW   RX   RY   RZ   R[   R\   R]   R^   R_   R`   Ra   Rb   Rc   Rd   Re   Rf   Rg   Rh   Ri   Rj   Rk   Rl   Rm   Rn   Ro   Rp   Rq   Rr   Rs   Rt   Ru   Rv   Rw   Rx   Ry   Rz   R{   R|   R}   R~   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyR      s  
				


		
			

					(   t   __doc__R   R.   R    R   t   objectR   R   (    (    (    s>   lib/python2.7/site-packages/sqlalchemy/testing/requirements.pyt   <module>   s
   