blob: c5d538dfa54dd3521805b015c57b23cc35317c92 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
from alembic.testing.requirements import SuiteRequirements
from alembic.testing import exclusions
from alembic import util
class DefaultRequirements(SuiteRequirements):
@property
def schemas(self):
"""Target database must support external schemas, and have one
named 'test_schema'."""
return exclusions.skip_if([
"sqlite",
"firebird"
], "no schema support")
@property
def no_referential_integrity(self):
"""test will fail if referential integrity is enforced"""
return exclusions.fails_on_everything_except("sqlite")
@property
def non_native_boolean(self):
"""test will fail if native boolean is provided"""
return exclusions.fails_if(
exclusions.LambdaPredicate(
lambda config: config.db.dialect.supports_native_boolean
)
)
@property
def no_fk_names(self):
"""foreign key constraints *never* have names in the DB"""
return exclusions.only_if(
lambda config: exclusions.against(config, "sqlite")
and not util.sqla_100
)
@property
def check_constraints_w_enforcement(self):
return exclusions.fails_on("mysql")
@property
def unnamed_constraints(self):
"""constraints without names are supported."""
return exclusions.only_on(['sqlite'])
@property
def fk_names(self):
"""foreign key constraints always have names in the DB"""
return exclusions.fails_on('sqlite')
@property
def reflects_unique_constraints_unambiguously(self):
return exclusions.fails_on("mysql")
@property
def reflects_pk_names(self):
"""Target driver reflects the name of primary key constraints."""
return exclusions.fails_on_everything_except(
'postgresql', 'oracle', 'mssql', 'sybase')
|