summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorjason3gb <jason3gb@gmail.com>2021-06-24 12:11:04 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-06-24 12:22:20 -0400
commit791f1d9407f68cc668c7078fa87784ebdf3bd688 (patch)
tree6d7a83795ddfe6e352899ea36105d306b62916a5 /test/sql
parentfb141d9d5e3116dc233138fa0cf78ffdd05be87a (diff)
downloadsqlalchemy-791f1d9407f68cc668c7078fa87784ebdf3bd688.tar.gz
Add "impl" parameter to PickleType
Add a impl parameter to :class:`_types.PickleType` constructor, allowing any arbitary type to be used in place of the default implementation of :class:`_types.LargeBinary`. Pull request courtesy jason3gb. Fixes: #6646 Closes: #6657 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6657 Pull-request-sha: e49bcd368d1f71dba92225d8d6e3af2bbe7142f7 Change-Id: Ib79f3b0ebbc94393f673f5a5ba6558260083d0cf
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_types.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/sql/test_types.py b/test/sql/test_types.py
index 9db0fee3b..3cbd2c07f 100644
--- a/test/sql/test_types.py
+++ b/test/sql/test_types.py
@@ -3809,6 +3809,23 @@ class PickleTest(fixtures.TestBase):
):
assert p1.compare_values(p1.copy_value(obj), obj)
+ @testing.combinations(
+ None, mysql.LONGBLOB, LargeBinary, mysql.LONGBLOB(), LargeBinary()
+ )
+ def test_customized_impl(self, impl):
+ """test #6646"""
+
+ if impl is None:
+ p1 = PickleType()
+ assert isinstance(p1.impl, LargeBinary)
+ else:
+ p1 = PickleType(impl=impl)
+
+ if not isinstance(impl, type):
+ impl = type(impl)
+
+ assert isinstance(p1.impl, impl)
+
class CallableTest(fixtures.TestBase):
@testing.provide_metadata