本文整理汇总了Python中sqlalchemy.testing.exclusions.skip_if函数的典型用法代码示例。如果您正苦于以下问题:Python skip_if函数的具体用法?Python skip_if怎么用?Python skip_if使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skip_if函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: time_microseconds
def time_microseconds(self):
"""target dialect supports representation of Python
datetime.time() with microsecond objects."""
return skip_if(
["mssql", "mysql", "firebird", "+zxjdbc", "oracle", "sybase"]
)
示例2: schemas
def schemas(self):
"""Target database must support external schemas, and have one
named 'test_schema'."""
return skip_if([
"firebird"
], "no schema support")
示例3: two_phase_transactions
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",
),
]
)
示例4: non_updating_cascade
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")
示例5: unbounded_varchar
def unbounded_varchar(self):
"""Target database must support VARCHAR with no length"""
return skip_if([
"firebird", "oracle", "mysql"
], "not supported by database"
)
示例6: two_phase_recovery
def two_phase_recovery(self):
return self.two_phase_transactions + (
skip_if(
"mysql",
"crashes on most mariadb and mysql versions"
)
)
示例7: savepoints
def savepoints(self):
"""Target database must support savepoints."""
return skip_if(
["sqlite", "sybase", ("mysql", "<", (5, 0, 3))],
"savepoints not supported",
)
示例8: postgresql_test_dblink
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",
)
示例9: binary_comparisons
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"
)
示例10: standalone_binds
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: on_update_cascade
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: boolean_col_expressions
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'),
])
示例13: precision_numerics_enotation_large
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")])
示例14: deferrable_or_no_constraints
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'),
])
示例15: on_update_cascade
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'
)