From 00b5c10846e800304caa86549ab9da373b42fa5d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 2 Aug 2019 12:34:16 -0400 Subject: Modernize internal reflection - Deprecated remaining engine-level introspection and utility methods including :meth:`.Engine.run_callable`, :meth:`.Engine.transaction`, :meth:`.Engine.table_names`, :meth:`.Engine.has_table`. The utility methods are superseded by modern context-manager patterns, and the table introspection tasks are suited by the :class:`.Inspector` object. - The internal dialect method ``Dialect.reflecttable`` has been removed. A review of third party dialects has not found any making use of this method, as it was already documented as one that should not be used by external dialects. Additionally, the private ``Engine._run_visitor`` method is also removed. - The long-deprecated ``Inspector.get_table_names.order_by`` parameter has been removed. - The :paramref:`.Table.autoload_with` parameter now accepts an :class:`.Inspector` object directly, as well as any :class:`.Engine` or :class:`.Connection` as was the case before. Fixes: #4755 Change-Id: Iec3a8b0f3e298ba87d532b16fac1e1132f464e21 --- test/dialect/postgresql/test_reflection.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/dialect/postgresql/test_reflection.py') diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 6e7d7202a..4b5c4b949 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -519,7 +519,7 @@ class ReflectionTest(fixtures.TestBase): @testing.provide_metadata def test_has_temporary_table(self): - assert not testing.db.has_table("some_temp_table") + assert not inspect(testing.db).has_table("some_temp_table") user_tmp = Table( "some_temp_table", self.metadata, @@ -528,7 +528,7 @@ class ReflectionTest(fixtures.TestBase): prefixes=["TEMPORARY"], ) user_tmp.create(testing.db) - assert testing.db.has_table("some_temp_table") + assert inspect(testing.db).has_table("some_temp_table") @testing.provide_metadata def test_cross_schema_reflection_one(self): @@ -845,10 +845,10 @@ class ReflectionTest(fixtures.TestBase): A_table = Table("A", metadata, Column("x", Integer)) a_table.create() - assert testing.db.has_table("a") - assert not testing.db.has_table("A") + assert inspect(testing.db).has_table("a") + assert not inspect(testing.db).has_table("A") A_table.create(checkfirst=True) - assert testing.db.has_table("A") + assert inspect(testing.db).has_table("A") def test_uppercase_lowercase_sequence(self): -- cgit v1.2.1