summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-04-11 16:11:59 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-04-11 16:11:59 +0000
commit6e1cbe426479438f1fc12ce6ae9424cf5d191ddf (patch)
tree90f780d9d13a225202edf5b0c2547d75dd430869 /test
parentaff41b2384e64c6d9739626791603a2becf0126c (diff)
parent3b10414c8974625622dfff08262272b39bcff85e (diff)
downloadsqlalchemy-6e1cbe426479438f1fc12ce6ae9424cf5d191ddf.tar.gz
Merge "The :meth:`.Inspector.reflecttable` was renamed to :meth:`.Inspector.reflect_table`."
Diffstat (limited to 'test')
-rw-r--r--test/engine/test_deprecations.py13
-rw-r--r--test/engine/test_reflection.py8
2 files changed, 17 insertions, 4 deletions
diff --git a/test/engine/test_deprecations.py b/test/engine/test_deprecations.py
index c9bf83f31..53df6c1a8 100644
--- a/test/engine/test_deprecations.py
+++ b/test/engine/test_deprecations.py
@@ -2,6 +2,7 @@ import sqlalchemy as tsa
from sqlalchemy import create_engine
from sqlalchemy import ForeignKey
from sqlalchemy import func
+from sqlalchemy import inspect
from sqlalchemy import INT
from sqlalchemy import Integer
from sqlalchemy import MetaData
@@ -524,6 +525,18 @@ class DeprecatedReflectionTest(fixtures.TablesTest):
table_names = testing.db.table_names()
is_true(set(table_names).issuperset(metadata.tables))
+ def test_reflecttable(self):
+ inspector = inspect(testing.db)
+ metadata = self.metadata
+ table = Table("user", metadata)
+ with testing.expect_deprecated_20(
+ r"The Inspector.reflecttable\(\) function/method is considered "
+ ):
+ res = inspector.reflecttable(table, None)
+ exp = inspector.reflect_table(table, None)
+
+ eq_(res, exp)
+
class ExecutionOptionsTest(fixtures.TestBase):
def test_branched_connection_execution_options(self):
diff --git a/test/engine/test_reflection.py b/test/engine/test_reflection.py
index 3a2a3c699..0fea029fe 100644
--- a/test/engine/test_reflection.py
+++ b/test/engine/test_reflection.py
@@ -1282,15 +1282,15 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
m = MetaData()
inspector = sa.engine.reflection.Inspector
- reflecttable = inspector.reflecttable
+ reflect_table = inspector.reflect_table
def patched(self, table, *arg, **kw):
if table.name == "rt_c":
raise sa.exc.UnreflectableTableError("Can't reflect rt_c")
else:
- return reflecttable(self, table, *arg, **kw)
+ return reflect_table(self, table, *arg, **kw)
- with mock.patch.object(inspector, "reflecttable", patched):
+ with mock.patch.object(inspector, "reflect_table", patched):
with expect_warnings("Skipping table rt_c: Can't reflect rt_c"):
m.reflect(bind=testing.db)
@@ -1685,7 +1685,7 @@ class UnicodeReflectionTest(fixtures.TestBase):
@testing.requires.unicode_connections
def test_basic(self):
# the 'convert_unicode' should not get in the way of the
- # reflection process. reflecttable for oracle, postgresql
+ # reflection process. reflect_table for oracle, postgresql
# (others?) expect non-unicode strings in result sets/bind
# params