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" )
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" )
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", )
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")
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")
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')
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")
def enforces_check_constraints(self): """Target database must also enforce check constraints.""" return self.check_constraints + fails_on( ['mysql'], "check constraints don't enforce" )
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")
def duplicate_key_raises_integrity_error(self): return fails_on("postgresql+pg8000")
def date_coerces_from_datetime(self): """target dialect accepts a datetime object as the target of a date column.""" return fails_on('mysql+mysqlconnector')
def enforces_check_constraints(self): """Target database must also enforce check constraints.""" return self.check_constraints + fails_on( ['mysql'], "check constraints don't enforce")
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')
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")
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")