summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2021-02-28 16:16:09 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2021-02-28 16:16:09 +0000
commit844914bf9043a0213df2eb3358790e9975a88f4a (patch)
tree3ee397e6d23a282ff17098a856962740f379cffe /test/sql
parentaae934d171ab0eaaa6b53db4e1db65b0d20ff1e9 (diff)
parent0c31059a1d6303d2d16b59eb6a5c2c751acdf14a (diff)
downloadsqlalchemy-844914bf9043a0213df2eb3358790e9975a88f4a.tar.gz
Merge "support stringify for plain CTE"
Diffstat (limited to 'test/sql')
-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 9e818e997..7d1817b29 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -4323,6 +4323,17 @@ class StringifySpecialTest(fixtures.TestBase):
"SELECT anon_1.myid FROM anon_1",
)
+ @testing.combinations(("cte",), ("alias",), ("subquery",))
+ def test_grouped_selectables_print_alone(self, modifier):
+ stmt = select(table1).where(table1.c.myid == 10)
+
+ grouped = getattr(stmt, modifier)()
+ eq_ignore_whitespace(
+ str(grouped),
+ "SELECT mytable.myid, mytable.name, "
+ "mytable.description FROM mytable WHERE mytable.myid = :myid_1",
+ )
+
def test_next_sequence_value(self):
# using descriptive text that is intentionally not compatible
# with any particular backend, since all backends have different