summaryrefslogtreecommitdiff
path: root/test/engine
diff options
context:
space:
mode:
authorAsif Saif Uddin (Auvi) <auvipy@gmail.com>2019-10-06 12:32:10 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-10-11 13:29:38 -0400
commitd9d576f1fda3687c3475511805895925ceba53b0 (patch)
tree75824f3984f6c8e50038c6a0fa38662200361dfe /test/engine
parent476df84ec995324cf2162b9b28ad8a58b90cfadf (diff)
downloadsqlalchemy-d9d576f1fda3687c3475511805895925ceba53b0.tar.gz
Remove deprecated elements
Includes: PassiveDefault SchemaItem.quote Table.useexisting Table.quote_schema Table.append_ddl_listener MetaData.append_ddl_listener Metadata.reflect kw parameter (use reflect() method) DDL.execute_at DDL.on Partially-fixes: #4643 Closes: #4893 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4893 Pull-request-sha: 860eb6a253fe4a95685b4f5f3349b19823a304f3 Change-Id: I0f5b8a873e7581365ff8dba48eab358d9e8e7b13
Diffstat (limited to 'test/engine')
-rw-r--r--test/engine/test_ddlevents.py80
-rw-r--r--test/engine/test_reflection.py10
2 files changed, 1 insertions, 89 deletions
diff --git a/test/engine/test_ddlevents.py b/test/engine/test_ddlevents.py
index c1214932d..8f5834cc9 100644
--- a/test/engine/test_ddlevents.py
+++ b/test/engine/test_ddlevents.py
@@ -428,28 +428,6 @@ class DDLExecutionTest(fixtures.TestBase):
assert "xyzzy" in strings
assert "fnord" in strings
- @testing.uses_deprecated(r".*use the DDLEvents")
- def test_table_by_metadata_deprecated(self):
- metadata, users, engine = self.metadata, self.users, self.engine
- DDL("mxyzptlk").execute_at("before-create", users)
- DDL("klptzyxm").execute_at("after-create", users)
- DDL("xyzzy").execute_at("before-drop", users)
- DDL("fnord").execute_at("after-drop", users)
-
- metadata.create_all()
- strings = [str(x) for x in engine.mock]
- assert "mxyzptlk" in strings
- assert "klptzyxm" in strings
- assert "xyzzy" not in strings
- assert "fnord" not in strings
- del engine.mock[:]
- metadata.drop_all()
- strings = [str(x) for x in engine.mock]
- assert "mxyzptlk" not in strings
- assert "klptzyxm" not in strings
- assert "xyzzy" in strings
- assert "fnord" in strings
-
def test_metadata(self):
metadata, engine = self.metadata, self.engine
@@ -472,29 +450,6 @@ class DDLExecutionTest(fixtures.TestBase):
assert "xyzzy" in strings
assert "fnord" in strings
- @testing.uses_deprecated(r".*use the DDLEvents")
- def test_metadata_deprecated(self):
- metadata, engine = self.metadata, self.engine
-
- DDL("mxyzptlk").execute_at("before-create", metadata)
- DDL("klptzyxm").execute_at("after-create", metadata)
- DDL("xyzzy").execute_at("before-drop", metadata)
- DDL("fnord").execute_at("after-drop", metadata)
-
- metadata.create_all()
- strings = [str(x) for x in engine.mock]
- assert "mxyzptlk" in strings
- assert "klptzyxm" in strings
- assert "xyzzy" not in strings
- assert "fnord" not in strings
- del engine.mock[:]
- metadata.drop_all()
- strings = [str(x) for x in engine.mock]
- assert "mxyzptlk" not in strings
- assert "klptzyxm" not in strings
- assert "xyzzy" in strings
- assert "fnord" in strings
-
def test_conditional_constraint(self):
metadata, users = self.metadata, self.users
nonpg_mock = engines.mock_engine(dialect_name="sqlite")
@@ -531,37 +486,6 @@ class DDLExecutionTest(fixtures.TestBase):
strings = " ".join(str(x) for x in pg_mock.mock)
assert "my_test_constraint" in strings
- @testing.uses_deprecated(r".*use the DDLEvents")
- def test_conditional_constraint_deprecated(self):
- metadata, users = self.metadata, self.users
- nonpg_mock = engines.mock_engine(dialect_name="sqlite")
- pg_mock = engines.mock_engine(dialect_name="postgresql")
- constraint = CheckConstraint(
- "a < b", name="my_test_constraint", table=users
- )
-
- # by placing the constraint in an Add/Drop construct, the
- # 'inline_ddl' flag is set to False
-
- AddConstraint(constraint, on="postgresql").execute_at(
- "after-create", users
- )
- DropConstraint(constraint, on="postgresql").execute_at(
- "before-drop", users
- )
- metadata.create_all(bind=nonpg_mock)
- strings = " ".join(str(x) for x in nonpg_mock.mock)
- assert "my_test_constraint" not in strings
- metadata.drop_all(bind=nonpg_mock)
- strings = " ".join(str(x) for x in nonpg_mock.mock)
- assert "my_test_constraint" not in strings
- metadata.create_all(bind=pg_mock)
- strings = " ".join(str(x) for x in pg_mock.mock)
- assert "my_test_constraint" in strings
- metadata.drop_all(bind=pg_mock)
- strings = " ".join(str(x) for x in pg_mock.mock)
- assert "my_test_constraint" in strings
-
@testing.requires.sqlite
def test_ddl_execute(self):
engine = create_engine("sqlite:///")
@@ -630,9 +554,7 @@ class DDLTest(fixtures.TestBase, AssertsCompiledSQL):
def executor(*a, **kw):
return None
- engine = create_mock_engine(
- testing.db.name + "://", executor
- )
+ engine = create_mock_engine(testing.db.name + "://", executor)
# fmt: off
engine.dialect.identifier_preparer = \
tsa.sql.compiler.IdentifierPreparer(
diff --git a/test/engine/test_reflection.py b/test/engine/test_reflection.py
index 2bff3fa62..60352b538 100644
--- a/test/engine/test_reflection.py
+++ b/test/engine/test_reflection.py
@@ -1182,16 +1182,6 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
e = engines.testing_engine(options={"poolclass": AssertionPool})
fn(e)
- @testing.uses_deprecated()
- def test_reflect_uses_bind_constructor_conn(self):
- self._test_reflect_uses_bind(
- lambda e: MetaData(e.connect(), reflect=True)
- )
-
- @testing.uses_deprecated()
- def test_reflect_uses_bind_constructor_engine(self):
- self._test_reflect_uses_bind(lambda e: MetaData(e, reflect=True))
-
def test_reflect_uses_bind_constructor_conn_reflect(self):
self._test_reflect_uses_bind(lambda e: MetaData(e.connect()).reflect())