From 2c2c6a3fe8e4ee29026ba7016e3a5d5b2850ec6b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 24 Aug 2012 16:14:47 -0400 Subject: - correct the argument signature for GenericFunction to be more predictable --- test/sql/test_functions.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/sql/test_functions.py') 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)') -- cgit v1.2.1