diff options
| author | Michael Trier <mtrier@gmail.com> | 2008-10-04 02:57:19 +0000 |
|---|---|---|
| committer | Michael Trier <mtrier@gmail.com> | 2008-10-04 02:57:19 +0000 |
| commit | dc5f360cd3e94f43f90b7cee3c8b5ba3de2e26cf (patch) | |
| tree | e8695db1850020c4d3dd8e07b95d873866fdbd39 | |
| parent | 56e88ed7c3b4bd6890087d6d2ced6514076d56c3 (diff) | |
| download | sqlalchemy-dc5f360cd3e94f43f90b7cee3c8b5ba3de2e26cf.tar.gz | |
Didnt think about <2.5. When will I learn.
| -rw-r--r-- | test/sql/testtypes.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index c8b9d7f39..a3d813d0f 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -797,6 +797,19 @@ class BooleanTest(TestBase, AssertsExecutionResults): print res2 assert(res2==[(2, False)]) +try: + from functools import partial +except: + def partial(func, *args, **keywords): + def newfunc(*fargs, **fkeywords): + 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): def setUpAll(self): global meta @@ -806,7 +819,6 @@ class CallableTest(TestBase, AssertsExecutionResults): meta.drop_all() def test_callable_as_arg(self): - from functools import partial ucode = partial(Unicode, assert_unicode=None) thing_table = Table('thing', meta, @@ -814,7 +826,6 @@ class CallableTest(TestBase, AssertsExecutionResults): ) def test_callable_as_kwarg(self): - from functools import partial ucode = partial(Unicode, assert_unicode=None) thang_table = Table('thang', meta, |
