diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2018-01-17 18:09:00 -0500 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci.zzzcomputing.com> | 2018-01-17 18:09:00 -0500 |
| commit | a05a6d06fa7da5e5bcaaf21ceb7a6993a2b32829 (patch) | |
| tree | 6fa54fa50fb5641d50e4a9b099b3369527d5338a /lib/sqlalchemy | |
| parent | e30d7e7f6c283e6f8176cc43fdac12f9e95c6bbf (diff) | |
| parent | afb121b0af8bd8a08f02031b5cf443b72dac952b (diff) | |
| download | sqlalchemy-a05a6d06fa7da5e5bcaaf21ceb7a6993a2b32829.tar.gz | |
Merge "Normalize check constraints even more radically"
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_reflection.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py index f541165e3..0c391fad0 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -789,12 +789,15 @@ class ComponentReflectionTest(fixtures.TablesTest): key=operator.itemgetter('name') ) + # trying to minimize effect of quoting, parenthesis, etc. + # may need to add more to this as new dialects get CHECK + # constraint reflection support + def normalize(sqltext): + return " ".join(re.findall(r"and|\d|=|a|or|<|>", sqltext.lower(), re.I)) + reflected = [ {"name": item["name"], - # trying to minimize effect of quoting, parenthesis, etc. - # may need to add more to this as new dialects get CHECK - # constraint reflection support - "sqltext": re.sub(r"[`'\(\)]", '', item["sqltext"].lower())} + "sqltext": normalize(item["sqltext"])} for item in reflected ] eq_( |
