Пример #1
0
    def schemas(self):
        """Target database must support external schemas, and have one
        named 'test_schema'."""

        return skip_if([
                    "firebird"
                ], "no schema support")
Пример #2
0
 def postgresql_test_dblink(self):
     return skip_if(
         lambda config: not config.file_config.has_option(
             "sqla_testing", "postgres_test_db_link"
         ),
         "postgres_test_db_link option not specified in config",
     )
Пример #3
0
    def time_microseconds(self):
        """target dialect supports representation of Python
        datetime.time() with microsecond objects."""

        return skip_if(
            ["mssql", "mysql", "firebird", "+zxjdbc", "oracle", "sybase"]
        )
Пример #4
0
    def two_phase_transactions(self):
        """Target database must support two-phase transactions."""

        return skip_if(
            [
                no_support("firebird", "no SA implementation"),
                no_support("mssql", "two-phase xact not supported by drivers"),
                no_support(
                    "oracle", "two-phase xact not implemented in SQLA/oracle"
                ),
                no_support(
                    "drizzle", "two-phase xact not supported by database"
                ),
                no_support(
                    "sqlite", "two-phase xact not supported by database"
                ),
                no_support(
                    "sybase", "two-phase xact not supported by drivers/SQLA"
                ),
                no_support(
                    "postgresql+zxjdbc",
                    "FIXME: JDBC driver confuses the transaction state, "
                    "may need separate XA implementation",
                ),
                no_support(
                    "mysql",
                    "recent MySQL communiity editions have too many issues "
                    "(late 2016), disabling for now",
                ),
            ]
        )
Пример #5
0
    def non_updating_cascade(self):
        """target database must *not* support ON UPDATE..CASCADE behavior in
        foreign keys."""

        return fails_on_everything_except(
            "sqlite", "oracle", "+zxjdbc"
        ) + skip_if("mssql")
Пример #6
0
 def binary_comparisons(self):
     """target database/driver can allow BLOB/BINARY fields to be compared
     against a bound parameter value.
     """
     return skip_if(["oracle", "mssql"],
             "not supported by database/driver"
         )
Пример #7
0
    def unbounded_varchar(self):
        """Target database must support VARCHAR with no length"""

        return skip_if([
                "firebird", "oracle", "mysql"
            ], "not supported by database"
            )
Пример #8
0
 def two_phase_recovery(self):
     return self.two_phase_transactions + (
         skip_if(
            "mysql",
            "crashes on most mariadb and mysql versions"
         )
     )
Пример #9
0
    def savepoints(self):
        """Target database must support savepoints."""

        return skip_if(
            ["sqlite", "sybase", ("mysql", "<", (5, 0, 3))],
            "savepoints not supported",
        )
Пример #10
0
    def standalone_binds(self):
        """target database/driver supports bound parameters as column expressions
        without being in the context of a typed column.

        """
        return skip_if(["firebird", "mssql+mxodbc"],
                "not supported by driver")
Пример #11
0
    def on_update_cascade(self):
        """target database must support ON UPDATE..CASCADE behavior in
        foreign keys."""

        return skip_if(
            ["sqlite", "oracle"],
            "target backend %(doesnt_support)s ON UPDATE CASCADE",
        )
Пример #12
0
    def precision_numerics_enotation_large(self):
        """target backend supports Decimal() objects using E notation
        to represent very large values."""

        return skip_if(
            [("sybase+pyodbc", None, None,
              "Don't know how do get these values through FreeTDS + Sybase"),
             ("firebird", None, None, "Precision must be from 1 to 18")])
Пример #13
0
 def unicode_connections(self):
     """
     Target driver must support some encoding of Unicode across the wire.
     """
     # TODO: expand to exclude MySQLdb versions w/ broken unicode
     return skip_if([
         exclude('mysql', '<', (4, 1, 1), 'no unicode connection support'),
         ])
Пример #14
0
    def threading_with_mock(self):
        """Mark tests that use threading and mock at the same time - stability
        issues have been observed with coverage + python 3.3

        """
        return skip_if(
            lambda: util.py3k and self.config.options.enable_plugin_coverage, "Stability issues with coverage + py3k"
        )
Пример #15
0
    def dbapi_lastrowid(self):
        """"target backend includes a 'lastrowid' accessor on the DBAPI
        cursor object.

        """
        return skip_if('mssql+pymssql', 'crashes on pymssql') + \
                    fails_on_everything_except('mysql',
                                       'sqlite+pysqlite', 'sqlite+pysqlcipher')
Пример #16
0
    def deferrable_or_no_constraints(self):
        """Target database must support derferable constraints."""

        return skip_if([
            no_support('firebird', 'not supported by database'),
            no_support('mysql', 'not supported by database'),
            no_support('mssql', 'not supported by database'),
            ])
Пример #17
0
    def on_update_cascade(self):
        """target database must support ON UPDATE..CASCADE behavior in
        foreign keys."""

        return skip_if(
                    ['sqlite', 'oracle'],
                    'target backend does not support ON UPDATE CASCADE'
                )
Пример #18
0
 def percent_schema_names(self):
     return skip_if(
             [
                 ("+psycopg2", None, None,
                         "psycopg2 2.4 no longer accepts % in bind placeholders"),
                 ("mysql", None, None, "executemany() doesn't work here")
             ]
         )
Пример #19
0
 def boolean_col_expressions(self):
     """Target database must support boolean expressions as columns"""
     return skip_if([
         no_support('firebird', 'not supported by database'),
         no_support('oracle', 'not supported by database'),
         no_support('mssql', 'not supported by database'),
         no_support('sybase', 'not supported by database'),
     ])
Пример #20
0
    def reflectable_autoincrement(self):
        """Target database must support tables that can automatically generate
        PKs assuming they were reflected.

        this is essentially all the DBs in "identity" plus Postgresql, which
        has SERIAL support.  FB and Oracle (and sybase?) require the Sequence to
        be explicitly added, including if the table was reflected.
        """
        return skip_if(["firebird", "oracle", "sybase"], "not supported by database")
Пример #21
0
    def ad_hoc_engines(self):
        """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.

        """
        return skip_if(lambda: self.config.options.low_connections)
Пример #22
0
 def unicode_ddl(self):
     """Target driver must support some degree of non-ascii symbol names."""
     # TODO: expand to exclude MySQLdb versions w/ broken unicode
     return skip_if([
         no_support('oracle', 'FIXME: no support in database?'),
         no_support('sybase', 'FIXME: guessing, needs confirmation'),
         no_support('mssql+pymssql', 'no FreeTDS support'),
         exclude('mysql', '<', (4, 1, 1), 'no unicode connection support'),
         ])
Пример #23
0
    def independent_cursors(self):
        """Target must support simultaneous, independent database cursors
        on a single connection."""

        return skip_if(
            [
                "mssql",
                "mysql"], "no driver support"
        )
Пример #24
0
    def memory_process_intensive(self):
        """Driver is able to handle the memory tests which run in a subprocess
        and iterate through hundreds of connections

        """
        return skip_if([
            no_support("oracle", "Oracle XE usually can't handle these"),
            no_support("mssql+pyodbc", "MS ODBC drivers struggle")
        ])
Пример #25
0
    def savepoints(self):
        """Target database must support savepoints."""

        return skip_if([
                    "sqlite",
                    "sybase",
                    ("mysql", "<", (5, 0, 3)),
                    ("informix", "<", (11, 55, "xC3"))
                    ], "savepoints not supported")
Пример #26
0
    def identity(self):
        """Target database must support GENERATED AS IDENTITY or a facsimile.

        Includes GENERATED AS IDENTITY, AUTOINCREMENT, AUTO_INCREMENT, or other
        column DDL feature that fills in a DB-generated identifier at INSERT-time
        without requiring pre-execution of a SEQUENCE or other artifact.

        """
        return skip_if(["firebird", "oracle", "postgresql", "sybase"], "not supported by database")
Пример #27
0
    def correlated_outer_joins(self):
        """Target must support an outer join to a subquery which
        correlates to the parent."""

        return skip_if(
            "oracle",
            'Raises "ORA-01799: a column may not be '
            'outer-joined to a subquery"',
        )
Пример #28
0
    def dbapi_lastrowid(self):
        """"target backend includes a 'lastrowid' accessor on the DBAPI
        cursor object.

        """
        return skip_if(
            "mssql+pymssql", "crashes on pymssql"
        ) + fails_on_everything_except(
            "mysql", "sqlite+pysqlite", "sqlite+pysqlcipher"
        )
Пример #29
0
    def deferrable_or_no_constraints(self):
        """Target database must support deferrable constraints."""

        return skip_if(
            [
                no_support("firebird", "not supported by database"),
                no_support("mysql", "not supported by database"),
                no_support("mssql", "not supported by database"),
            ]
        )
Пример #30
0
 def unicode_ddl(self):
     """Target driver must support some encoding of Unicode across the wire."""
     # TODO: expand to exclude MySQLdb versions w/ broken unicode
     return skip_if([
         no_support('maxdb', 'database support flakey'),
         no_support('oracle', 'FIXME: no support in database?'),
         no_support('sybase', 'FIXME: guessing, needs confirmation'),
         no_support('mssql+pymssql', 'no FreeTDS support'),
         exclude('mysql', '<', (4, 1, 1), 'no unicode connection support'),
         ])
Пример #31
0
    def time(self):
        """target dialect supports representation of Python
        datetime.time() objects."""

        return skip_if(['oracle'])
Пример #32
0
    def implicitly_named_constraints(self):
        """target database must apply names to unnamed constraints."""

        return skip_if([
            no_support('sqlite', 'not supported by database'),
        ])
Пример #33
0
    def skip_mysql_on_windows(self):
        """Catchall for a large variety of MySQL on Windows failures"""

        return skip_if(self._has_mysql_on_windows,
                       "Not supported on MySQL + Windows")
Пример #34
0
    def updateable_autoincrement_pks(self):
        """Target must support UPDATE on autoincrement/integer primary key."""

        return skip_if(["mssql", "sybase"],
                       "IDENTITY columns can't be updated")
Пример #35
0
 def ad_hoc_engines(self):
     return exclusions.skip_if(["oracle"])
Пример #36
0
 def implements_get_lastrowid(self):
     return skip_if([
         no_support('sybase', 'not supported by database'),
     ])
Пример #37
0
    def subqueries(self):
        """Target database must support subqueries."""

        return skip_if(exclude('mysql', '<', (4, 1, 1)), 'no subquery support')
Пример #38
0
    def views(self):
        """Target database must support VIEWs."""

        return skip_if("drizzle", "no VIEW support")
Пример #39
0
 def postgresql_test_dblink(self):
     return skip_if(
         lambda config: not config.file_config.has_option(
             'sqla_testing', 'postgres_test_db_link'),
         "postgres_test_db_link option not specified in config")
Пример #40
0
 def binary_comparisons(self):
     """target database/driver can allow BLOB/BINARY fields to be compared
     against a bound parameter value.
     """
     return skip_if(["oracle", "mssql"], "not supported by database/driver")
Пример #41
0
    def on_update_cascade(self):
        """target database must support ON UPDATE..CASCADE behavior in
        foreign keys."""

        return skip_if(['sqlite', 'oracle'],
                       'target backend %(doesnt_support)s ON UPDATE CASCADE')
Пример #42
0
 def temporary_tables(self):
     """target database supports temporary tables"""
     return skip_if(["mssql", "firebird"], "not supported (?)")
Пример #43
0
    def non_updating_cascade(self):
        """target database must *not* support ON UPDATE..CASCADE behavior in
        foreign keys."""

        return fails_on_everything_except('sqlite', 'oracle', '+zxjdbc') + \
            skip_if('mssql')
Пример #44
0
 def fetch_rows_post_commit(self):
     return skip_if(["firebird"], "not supported")
Пример #45
0
 def selectone(self):
     """target driver must support the literal statement 'select 1'"""
     return skip_if(["oracle", "firebird"],
                    "non-standard SELECT scalar syntax")
Пример #46
0
 def insert_from_select(self):
     return skip_if(["firebird"], "crashes for unknown reason")
Пример #47
0
 def sane_rowcount(self):
     return skip_if(
         lambda config: not config.db.dialect.supports_sane_rowcount,
         "driver doesn't support 'sane' rowcount")
Пример #48
0
 def savepoints_w_release(self):
     return self.savepoints + skip_if(
         "oracle", "oracle doesn't support release of savepoint")
Пример #49
0
 def unicode_data(self):
     """target drive must support unicode data stored in columns."""
     return skip_if([no_support("sybase", "no unicode driver support")])
Пример #50
0
    def independent_cursors(self):
        """Target must support simultaneous, independent database cursors
        on a single connection."""

        return skip_if(["mssql+pyodbc", "mssql+mxodbc"], "no driver support")
Пример #51
0
 def two_phase_recovery(self):
     return self.two_phase_transactions + (skip_if(
         "mysql", "crashes on most mariadb and mysql versions"))
Пример #52
0
 def oracle_test_dblink(self):
     return skip_if(
         lambda config: not config.file_config.has_option(
             'sqla_testing', 'oracle_db_link'),
         "oracle_db_link option not specified in config")
Пример #53
0
 def update_nowait(self):
     """Target database must support SELECT...FOR UPDATE NOWAIT"""
     return skip_if(["firebird", "mssql", "mysql", "sqlite", "sybase"],
                    "no FOR UPDATE NOWAIT support")
Пример #54
0
 def fetch_null_from_numeric(self):
     return skip_if(
         ("mssql+pyodbc", None, None, "crashes due to bug #351"), )
Пример #55
0
 def unique_constraint_reflection_no_index_overlap(self):
     return self.unique_constraint_reflection + skip_if("mysql")
Пример #56
0
    def foreign_keys(self):
        """Target database must support foreign keys."""

        return skip_if(no_support('sqlite', 'not supported by database'))
Пример #57
0
    def schemas(self):
        """Target database must support external schemas, and have one
        named 'test_schema'."""

        return skip_if(["firebird"], "no schema support")
Пример #58
0
    def time_microseconds(self):
        """target dialect supports representation of Python
        datetime.time() with microsecond objects."""

        return skip_if(
            ['mssql', 'mysql', 'firebird', '+zxjdbc', 'oracle', 'sybase'])
Пример #59
0
    def standalone_binds(self):
        """target database/driver supports bound parameters as column expressions
        without being in the context of a typed column.

        """
        return skip_if(["firebird", "mssql+mxodbc"], "not supported by driver")
Пример #60
0
 def postgresql_jsonb(self):
     return only_on("postgresql >= 9.4") + skip_if(
         lambda config: config.db.dialect.driver == "pg8000" and config.db.
         dialect._dbapi_version <= (1, 10, 1))