summaryrefslogtreecommitdiff
path: root/test/sql/test_functions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-02-12 19:54:49 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-02-12 19:54:49 +0000
commitd0d5f792404126f2f3f62cb850e6b887c246178e (patch)
tree05d7718d9500c6bcd43e6f74b9365e895f609191 /test/sql/test_functions.py
parent85d335b01bf64a27e99cee915205afd99e7191b5 (diff)
downloadsqlalchemy-d0d5f792404126f2f3f62cb850e6b887c246178e.tar.gz
- Made sqlalchemy.sql.expressions.Executable part of public
API, used for any expression construct that can be sent to execute(). FunctionElement now inherits Executable so that it gains execution_options(), which are also propagated to the select() that's generated within execute(). Executable in turn subclasses _Generative which marks any ClauseElement that supports the @_generative decorator - these may also become "public" for the benefit of the compiler extension at some point.
Diffstat (limited to 'test/sql/test_functions.py')
-rw-r--r--test/sql/test_functions.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py
index e6bcd2680..960bb6652 100644
--- a/test/sql/test_functions.py
+++ b/test/sql/test_functions.py
@@ -215,7 +215,21 @@ class ExecuteTest(TestBase):
finally:
conn.close()
assert (x == y == z == q) is True
-
+
+ def test_exec_options(self):
+ f = func.foo()
+ eq_(f._execution_options, {})
+
+ f = f.execution_options(foo='bar')
+ eq_(f._execution_options, {'foo':'bar'})
+ s = f.select()
+ eq_(s._execution_options, {'foo':'bar'})
+
+ ret = testing.db.execute(func.now().execution_options(foo='bar'))
+ eq_(ret.context.execution_options, {'foo':'bar'})
+ ret.close()
+
+
@engines.close_first
def test_update(self):
"""