summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing/schema.py')
-rw-r--r--lib/sqlalchemy/testing/schema.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/schema.py b/lib/sqlalchemy/testing/schema.py
index e4a92a732..46cbf4759 100644
--- a/lib/sqlalchemy/testing/schema.py
+++ b/lib/sqlalchemy/testing/schema.py
@@ -23,7 +23,7 @@ __all__ = ["Table", "Column"]
table_options = {}
-def Table(*args, **kw):
+def Table(*args, **kw) -> schema.Table:
"""A schema.Table wrapper/hook for dialect-specific tweaks."""
test_opts = {k: kw.pop(k) for k in list(kw) if k.startswith("test_")}
@@ -134,6 +134,19 @@ class eq_type_affinity:
return self.target._type_affinity is not other._type_affinity
+class eq_compile_type:
+ """similar to eq_type_affinity but uses compile"""
+
+ def __init__(self, target):
+ self.target = target
+
+ def __eq__(self, other):
+ return self.target == other.compile()
+
+ def __ne__(self, other):
+ return self.target != other.compile()
+
+
class eq_clause_element:
"""Helper to compare SQL structures based on compare()"""