]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- add a test for [ticket:2927], which is an 0.9 issue but only because 0.8
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Jan 2014 22:09:50 +0000 (17:09 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Jan 2014 22:09:50 +0000 (17:09 -0500)
isn't annotating correctly

test/sql/test_functions.py

index b325b7763af20d17249bb573a322ab4a45e17228..a01929f700e2ec420373ae1471a0600e3357613c 100644 (file)
@@ -77,6 +77,15 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         ]:
             self.assert_compile(func.random(), ret, dialect=dialect)
 
+    def test_generic_annotation(self):
+        # test [ticket:2927]:
+        # this passes in 0.8 because we forget to
+        # pre-annotate the "functions.XYZ" classes in sql.util
+        fn = func.coalesce('x', 'y')._annotate({"foo": "bar"})
+        self.assert_compile(
+            fn, "coalesce(:param_1, :param_2)"
+        )
+
     def test_custom_default_namespace(self):
         class myfunc(GenericFunction):
             pass