diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-24 16:14:47 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-24 16:14:47 -0400 |
commit | 2c2c6a3fe8e4ee29026ba7016e3a5d5b2850ec6b (patch) | |
tree | f60ac600f584a33a9e6c16deaae48eccd4971fa5 /test/sql/test_functions.py | |
parent | 17f9bc5735b021201c1800adc2236b3fe67262b2 (diff) | |
download | sqlalchemy-2c2c6a3fe8e4ee29026ba7016e3a5d5b2850ec6b.tar.gz |
- correct the argument signature for GenericFunction to be more predictable
Diffstat (limited to 'test/sql/test_functions.py')
-rw-r--r-- | test/sql/test_functions.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py index 5769e4a1a..b69f8f6ba 100644 --- a/test/sql/test_functions.py +++ b/test/sql/test_functions.py @@ -38,7 +38,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): __return_type__ = sqltypes.Integer def __init__(self, arg, **kwargs): - GenericFunction.__init__(self, args=[arg], **kwargs) + GenericFunction.__init__(self, arg, **kwargs) self.assert_compile( fake_func('foo'), @@ -114,6 +114,15 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): assert isinstance(func.mypackage.myfunc(), f1) assert isinstance(func.myotherpackage.myfunc(), f2) + def test_custom_args(self): + class myfunc(GenericFunction): + pass + + self.assert_compile( + myfunc(1, 2, 3), + "myfunc(:param_1, :param_2, :param_3)" + ) + def test_namespacing_conflicts(self): self.assert_compile(func.text('foo'), 'text(:text_1)') |