diff options
| -rw-r--r-- | lib/sqlalchemy/schema.py | 2 | ||||
| -rw-r--r-- | test/sql/testtypes.py | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index d859b9061..df994d689 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -548,6 +548,8 @@ class Column(SchemaItem, expression._ColumnClause): name = args.pop(0) if args: coltype = args[0] + + # adjust for partials if callable(coltype): coltype = args[0]() diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index a3d813d0f..2600cebd9 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -805,12 +805,9 @@ except: newkeywords = keywords.copy() newkeywords.update(fkeywords) return func(*(args + fargs), **newkeywords) - newfunc.func = func - newfunc.args = args - newfunc.keywords = keywords return newfunc -class CallableTest(TestBase, AssertsExecutionResults): +class CallableTest(TestBase): def setUpAll(self): global meta meta = MetaData(testing.db) @@ -824,6 +821,8 @@ class CallableTest(TestBase, AssertsExecutionResults): thing_table = Table('thing', meta, Column('name', ucode, primary_key=True) ) + assert isinstance(thing_table.c.name.type, Unicode) + thing_table.create() def test_callable_as_kwarg(self): ucode = partial(Unicode, assert_unicode=None) @@ -831,6 +830,8 @@ class CallableTest(TestBase, AssertsExecutionResults): thang_table = Table('thang', meta, Column('name', type_=ucode, primary_key=True) ) + assert isinstance(thang_table.c.name.type, Unicode) + thang_table.create() if __name__ == "__main__": testenv.main() |
