From 93b7767d00267ebe149cabcae7246b6796352eb8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 2 Feb 2020 13:24:40 -0500 Subject: Deprecate connection branching The :meth:`.Connection.connect` method is deprecated as is the concept of "connection branching", which copies a :class:`.Connection` into a new one that has a no-op ".close()" method. This pattern is oriented around the "connectionless execution" concept which is also being removed in 2.0. As part of this change we begin to move the internals away from "connectionless execution" overall. Remove the "connectionless execution" concept from the reflection internals and replace with explicit patterns at the Inspector level. Fixes: #5131 Change-Id: Id23d28a9889212ac5ae7329b85136157815d3e6f --- test/dialect/postgresql/test_reflection.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test/dialect/postgresql') diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index b410ca748..830a54eef 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -25,7 +25,6 @@ from sqlalchemy.dialects.postgresql import ExcludeConstraint from sqlalchemy.dialects.postgresql import INTEGER from sqlalchemy.dialects.postgresql import INTERVAL from sqlalchemy.dialects.postgresql import TSRANGE -from sqlalchemy.engine import reflection from sqlalchemy.sql.schema import CheckConstraint from sqlalchemy.testing import fixtures from sqlalchemy.testing import mock @@ -1199,7 +1198,7 @@ class ReflectionTest(fixtures.TestBase): metadata=self.metadata, ) enum_type.create(conn) - inspector = reflection.Inspector.from_engine(conn.engine) + inspector = inspect(conn) eq_( inspector.get_enums("test_schema"), [ @@ -1218,7 +1217,7 @@ class ReflectionTest(fixtures.TestBase): "cat", "dog", "rat", name="pet", metadata=self.metadata ) enum_type.create(testing.db) - inspector = reflection.Inspector.from_engine(testing.db) + inspector = inspect(testing.db) eq_( inspector.get_enums(), [ @@ -1356,7 +1355,7 @@ class ReflectionTest(fixtures.TestBase): ) enum_type.create(testing.db) schema_enum_type.create(testing.db) - inspector = reflection.Inspector.from_engine(testing.db) + inspector = inspect(testing.db) eq_( inspector.get_enums(), @@ -1392,7 +1391,7 @@ class ReflectionTest(fixtures.TestBase): def test_inspect_enum_empty(self): enum_type = postgresql.ENUM(name="empty", metadata=self.metadata) enum_type.create(testing.db) - inspector = reflection.Inspector.from_engine(testing.db) + inspector = inspect(testing.db) eq_( inspector.get_enums(), -- cgit v1.2.1