From 45e3b4d0c56321890c52e69f6eb36868ab3c2173 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 27 Dec 2011 17:03:53 -0500 Subject: [PATCH] add test for #2193 --- test/sql/test_types.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 1902c74c28..793d5cb125 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -364,6 +364,19 @@ class UserDefinedTest(fixtures.TablesTest, AssertsCompiledSQL): "MYTYPE foo TWO" ) + def test_user_defined_dialect_specific_args(self): + class MyType(types.UserDefinedType): + def __init__(self, foo='foo', **kwargs): + super(MyType, self).__init__() + self.foo = foo + self.dialect_specific_args = kwargs + def adapt(self, cls): + return cls(foo=self.foo, **self.dialect_specific_args) + t = MyType(bar='bar') + a = t.dialect_impl(testing.db.dialect) + eq_(a.foo, 'foo') + eq_(a.dialect_specific_args['bar'], 'bar') + @testing.provide_metadata def test_type_coerce(self): """test ad-hoc usage of custom types with type_coerce().""" -- 2.47.2