diff options
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_( |
