summaryrefslogtreecommitdiff
path: root/test/sql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-01-05 14:11:12 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-01-05 14:11:12 -0500
commit196f7ee6cc132aa0f31741af80fa5c0ba77efcf2 (patch)
treeef4b141ad83f1698b89f0e247f99475a0621a951 /test/sql/test_compiler.py
parent7658a4c73c1e60cc4549389a72a2af26acfa51fc (diff)
downloadsqlalchemy-196f7ee6cc132aa0f31741af80fa5c0ba77efcf2.tar.gz
- conjunctions like and_() and or_() can now accept generators as arguments.
Diffstat (limited to 'test/sql/test_compiler.py')
-rw-r--r--test/sql/test_compiler.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index a5916c825..53b9f68fc 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -853,6 +853,17 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
'otherid_1': 9, 'myid_1': 12}
)
+ # test a generator
+ self.assert_compile(
+ and_(
+ conj for conj in [
+ table1.c.myid == 12,
+ table1.c.name == 'asdf'
+ ]
+ ),
+ "mytable.myid = :myid_1 AND mytable.name = :name_1"
+ )
+
def test_nested_conjunctions_short_circuit(self):
"""test that empty or_(), and_() conjunctions are collapsed by
an enclosing conjunction."""