diff options
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r-- | lib/sqlalchemy/testing/__init__.py | 1 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_reflection.py | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/testing/__init__.py b/lib/sqlalchemy/testing/__init__.py index ab1198da8..582901579 100644 --- a/lib/sqlalchemy/testing/__init__.py +++ b/lib/sqlalchemy/testing/__init__.py @@ -20,6 +20,7 @@ from .assertions import eq_ # noqa from .assertions import eq_ignore_whitespace # noqa from .assertions import eq_regex # noqa from .assertions import expect_deprecated # noqa +from .assertions import expect_deprecated_20 # noqa from .assertions import expect_warnings # noqa from .assertions import in_ # noqa from .assertions import is_ # noqa diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index c74259bdf..d055ba86e 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -81,6 +81,10 @@ def expect_deprecated(*messages, **kw): return _expect_warnings(sa_exc.SADeprecationWarning, messages, **kw) +def expect_deprecated_20(*messages, **kw): + return _expect_warnings(sa_exc.RemovedIn20Warning, messages, **kw) + + def emits_warning_on(db, *messages): """Mark a test as emitting a warning on a specific dialect. diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py index f9ff46492..d375f0279 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -21,7 +21,6 @@ from ... import MetaData from ... import String from ... import testing from ... import types as sql_types -from ...engine.reflection import Inspector from ...schema import DDL from ...schema import Index from ...sql.elements import quoted_name @@ -661,7 +660,7 @@ class ComponentReflectionTest(fixtures.TablesTest): def test_deprecated_get_primary_keys(self): meta = self.metadata users = self.tables.users - insp = Inspector(meta.bind) + insp = inspect(meta.bind) assert_raises_message( sa_exc.SADeprecationWarning, r".*get_primary_keys\(\) method is deprecated", |