summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-10-12 19:51:53 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-10-12 19:51:53 +0000
commit3fcdb7cca05de3a90c4f3b9f96ae680618a26c41 (patch)
tree08b06b18589d8e4da906bda25ba1e3c5de144fa6 /test/sql
parent9e82f32f274e649b04740c819d21ba232c89cfff (diff)
parentc76e3776f52d0d69c8c4932ba53626d7190cf5f4 (diff)
downloadsqlalchemy-3fcdb7cca05de3a90c4f3b9f96ae680618a26c41.tar.gz
Merge "Deprecate bound metadata"
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_deprecations.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/sql/test_deprecations.py b/test/sql/test_deprecations.py
index f418eab6b..176c16208 100644
--- a/test/sql/test_deprecations.py
+++ b/test/sql/test_deprecations.py
@@ -14,6 +14,7 @@ from sqlalchemy import exc
from sqlalchemy import exists
from sqlalchemy import ForeignKey
from sqlalchemy import func
+from sqlalchemy import inspect
from sqlalchemy import INT
from sqlalchemy import Integer
from sqlalchemy import join
@@ -67,6 +68,28 @@ class ToMetaDataTest(fixtures.TestBase):
eq_(t2.name, "t")
+class BoundMetadataTest(fixtures.TestBase):
+ def test_arg_deprecated(self):
+ with testing.expect_deprecated_20(
+ "The MetaData.bind argument is deprecated"
+ ):
+ m1 = MetaData(testing.db)
+
+ Table("t", m1, Column("q", Integer))
+
+ with testing.expect_deprecated_20(
+ "The ``bind`` argument for schema methods that invoke SQL "
+ "against an engine or connection will be required"
+ ):
+ m1.create_all()
+ try:
+ assert "t" in inspect(testing.db).get_table_names()
+ finally:
+ m1.drop_all(testing.db)
+
+ assert "t" not in inspect(testing.db).get_table_names()
+
+
class DeprecationWarningsTest(fixtures.TestBase, AssertsCompiledSQL):
__backend__ = True