summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-10-18 12:29:41 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-10-18 12:29:41 -0400
commitba67f7dbc5eb7a1ed2a3e1b56df72a837130f7bb (patch)
tree973b833e6d31c076c25fb6c169b383f8e4cd0d7a /test/sql
parent2484ef34c27f3342e62bd6285bb3668e2c913090 (diff)
downloadsqlalchemy-ba67f7dbc5eb7a1ed2a3e1b56df72a837130f7bb.tar.gz
- [bug] TypeDecorator now includes a generic repr()
that works in terms of the "impl" type by default. This is a behavioral change for those TypeDecorator classes that specify a custom __init__ method; those types will need to re-define __repr__() if they need __repr__() to provide a faithful constructor representation. [ticket:2594]
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_types.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/sql/test_types.py b/test/sql/test_types.py
index 1d096d7c4..98bc51624 100644
--- a/test/sql/test_types.py
+++ b/test/sql/test_types.py
@@ -336,6 +336,12 @@ class UserDefinedTest(fixtures.TablesTest, AssertsCompiledSQL):
Float().dialect_impl(pg).__class__
)
+ def test_type_decorator_repr(self):
+ class MyType(TypeDecorator):
+ impl = VARCHAR
+
+ eq_(repr(MyType(45)), "MyType(length=45)")
+
def test_user_defined_typedec_impl_bind(self):
class TypeOne(types.TypeEngine):
def bind_processor(self, dialect):