summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-12-30 13:56:20 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-12-30 15:06:34 -0500
commit102b91d8950926f1215dd7c59c5b7f200b5c0f8b (patch)
treecd956c6a250f5a9602f094d1820085187e3bf743 /test
parente8507b21ec5e4420fbb6f0df8a14ee33501e26cd (diff)
downloadsqlalchemy-102b91d8950926f1215dd7c59c5b7f200b5c0f8b.tar.gz
Support TypeDecorator.get_dbapi_type() for setinpusizes
Adjusted the "setinputsizes" logic relied upon by the cx_Oracle, asyncpg and pg8000 dialects to support a :class:`.TypeDecorator` that includes an override the :meth:`.TypeDecorator.get_dbapi_type()` method. Change-Id: I5aa70abf0d9a9e2ca43309f2dd80b3fcd83881b9
Diffstat (limited to 'test')
-rw-r--r--test/orm/test_lazy_relations.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/orm/test_lazy_relations.py b/test/orm/test_lazy_relations.py
index e8da84841..c81de142c 100644
--- a/test/orm/test_lazy_relations.py
+++ b/test/orm/test_lazy_relations.py
@@ -1453,17 +1453,19 @@ class RefersToSelfLazyLoadInterferenceTest(fixtures.MappedTest):
class TypeCoerceTest(fixtures.MappedTest, testing.AssertsExecutionResults):
"""ORM-level test for [ticket:3531]"""
- # mysql is having a recursion issue in the bind_expression
- __only_on__ = ("sqlite", "postgresql")
+ __backend__ = True
class StringAsInt(TypeDecorator):
impl = String(50)
+ def get_dbapi_type(self, dbapi):
+ return dbapi.NUMBER
+
def column_expression(self, col):
return sa.cast(col, Integer)
def bind_expression(self, col):
- return sa.cast(col, String)
+ return sa.cast(col, String(50))
@classmethod
def define_tables(cls, metadata):