diff options
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/__init__.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/schema.py | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/__init__.py b/lib/sqlalchemy/testing/__init__.py index a3ce24226..a311efa74 100644 --- a/lib/sqlalchemy/testing/__init__.py +++ b/lib/sqlalchemy/testing/__init__.py @@ -60,6 +60,7 @@ from .exclusions import only_if from .exclusions import only_on from .exclusions import skip from .exclusions import skip_if +from .schema import eq_clause_element from .schema import eq_type_affinity from .util import adict from .util import fail diff --git a/lib/sqlalchemy/testing/schema.py b/lib/sqlalchemy/testing/schema.py index fee021cff..ede3702e5 100644 --- a/lib/sqlalchemy/testing/schema.py +++ b/lib/sqlalchemy/testing/schema.py @@ -156,6 +156,19 @@ class eq_type_affinity(object): return self.target._type_affinity is not other._type_affinity +class eq_clause_element(object): + """Helper to compare SQL structures based on compare()""" + + def __init__(self, target): + self.target = target + + def __eq__(self, other): + return self.target.compare(other) + + def __ne__(self, other): + return not self.target.compare(other) + + def _truncate_name(dialect, name): if len(name) > dialect.max_identifier_length: return ( |
