Exemplo n.º 1
0
    def enforces_check_constraints(self):
        """Target database must also enforce check constraints."""

        return self.check_constraints + fails_on(
            self._mysql_not_mariadb_102,
            "check constraints don't enforce on MySQL, MariaDB<10.2"
        )
Exemplo n.º 2
0
 def graceful_disconnects(self):
     """Target driver must raise a DBAPI-level exception, such as
     InterfaceError, when the underlying connection has been closed
     and the execute() method is called.
     """
     return fails_on(
                 "postgresql+pg8000", "Driver crashes"
             )
Exemplo n.º 3
0
 def isolation_level(self):
     return only_on(
         ("postgresql", "sqlite", "mysql", "mssql"),
         "DBAPI has no isolation level support",
     ) + fails_on(
         "postgresql+pypostgresql",
         "pypostgresql bombs on multiple isolation level calls",
     )
Exemplo n.º 4
0
    def implicit_decimal_binds(self):
        """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`

        """

        return exclusions.fails_on("mysql+mysqldb", "driver specific")
Exemplo n.º 5
0
    def implicit_decimal_binds(self):
        """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`

        """

        # fixed for mysqlclient in
        # https://github.com/PyMySQL/mysqlclient-python/commit/68b9662918577fc05be9610ef4824a00f2b051b0
        def check(config):
            if against(config, "mysql+mysqldb"):
                # can remove once post 1.3.13 is released
                try:
                    from MySQLdb import converters
                    from decimal import Decimal

                    return Decimal not in converters.conversions
                except:
                    return True

            return against(
                config, "mysql+mysqldb"
            ) and config.db.dialect._mysql_dbapi_version <= (1, 3, 13)

        return exclusions.fails_on(check, "fixed for mysqlclient post 1.3.13")
Exemplo n.º 6
0
 def isolation_level(self):
     return only_on(
                 ('postgresql', 'sqlite', 'mysql'),
                 "DBAPI has no isolation level support"
             ) + fails_on('postgresql+pypostgresql',
                       'pypostgresql bombs on multiple isolation level calls')
Exemplo n.º 7
0
    def date_coerces_from_datetime(self):
        """target dialect accepts a datetime object as the target
        of a date column."""

        # does not work as of pyodbc 4.0.22
        return fails_on('mysql+mysqlconnector') + skip_if("mssql+pyodbc")
Exemplo n.º 8
0
    def enforces_check_constraints(self):
        """Target database must also enforce check constraints."""

        return self.check_constraints + fails_on(
            ['mysql'], "check constraints don't enforce"
        )
Exemplo n.º 9
0
 def graceful_disconnects(self):
     """Target driver must raise a DBAPI-level exception, such as
     InterfaceError, when the underlying connection has been closed
     and the execute() method is called.
     """
     return fails_on("postgresql+pg8000", "Driver crashes")
Exemplo n.º 10
0
 def duplicate_key_raises_integrity_error(self):
     return fails_on("postgresql+pg8000")
Exemplo n.º 11
0
    def date_coerces_from_datetime(self):
        """target dialect accepts a datetime object as the target
        of a date column."""

        return fails_on('mysql+mysqlconnector')
Exemplo n.º 12
0
    def enforces_check_constraints(self):
        """Target database must also enforce check constraints."""

        return self.check_constraints + fails_on(
            ['mysql'], "check constraints don't enforce")
Exemplo n.º 13
0
 def isolation_level(self):
     return only_on(
         ('postgresql', 'sqlite', 'mysql', 'mssql'),
         "DBAPI has no isolation level support") \
         + fails_on('postgresql+pypostgresql',
                    'pypostgresql bombs on multiple isolation level calls')
Exemplo n.º 14
0
    def date_coerces_from_datetime(self):
        """target dialect accepts a datetime object as the target
        of a date column."""

        # does not work as of pyodbc 4.0.22
        return fails_on("mysql+mysqlconnector") + skip_if("mssql+pyodbc")
Exemplo n.º 15
0
    def date_coerces_from_datetime(self):
        """target dialect accepts a datetime object as the target
        of a date column."""

        return fails_on('mysql+mysqlconnector')
Exemplo n.º 16
0
 def duplicate_key_raises_integrity_error(self):
     return fails_on("postgresql+pg8000")
Exemplo n.º 17
0
    def enforces_check_constraints(self):
        """Target database must also enforce check constraints."""

        return self.check_constraints + fails_on(
            self._mysql_not_mariadb_102,
            "check constraints don't enforce on MySQL, MariaDB<10.2")