summaryrefslogtreecommitdiff
path: root/test/sql/test_deprecations.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-05-18 20:35:01 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-05-27 21:19:06 -0400
commit47552aa93bedcce3756dc89774f02db9f1868e68 (patch)
tree4a00be1f85b5964e8cf6d035ed94345eba0459e4 /test/sql/test_deprecations.py
parent8b2eb2a2d0f4c7e283d96cf3e5263b5dd48e3b14 (diff)
downloadsqlalchemy-47552aa93bedcce3756dc89774f02db9f1868e68.tar.gz
Use roles for ORM alias() conversion
as SELECT statements will have subquery() and not alias(), start getting ready for the places where the ORM coerces SELECTs into subqueries and be ready to warn about it Change-Id: I90d4b6cae2c72816c6b192016ce074589caf4731
Diffstat (limited to 'test/sql/test_deprecations.py')
-rw-r--r--test/sql/test_deprecations.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/sql/test_deprecations.py b/test/sql/test_deprecations.py
index 8e8591aec..90646c41d 100644
--- a/test/sql/test_deprecations.py
+++ b/test/sql/test_deprecations.py
@@ -486,6 +486,18 @@ class SubqueryCoercionsTest(fixtures.TestBase, AssertsCompiledSQL):
is_true(stmt.compare(select([table1.c.myid]).scalar_subquery()))
+ def test_fromclause_subquery(self):
+ stmt = select([table1.c.myid])
+ with testing.expect_deprecated(
+ "Implicit coercion of SELECT and textual SELECT constructs "
+ "into FROM clauses is deprecated"
+ ):
+ coerced = coercions.expect(
+ roles.StrictFromClauseRole, stmt, allow_select=True
+ )
+
+ is_true(coerced.compare(stmt.subquery()))
+
class TextTest(fixtures.TestBase, AssertsCompiledSQL):
__dialect__ = "default"