From 75ac0abc7d5653d10006769a881374a46b706db5 Mon Sep 17 00:00:00 2001 From: Gord Thompson Date: Sun, 13 Sep 2020 12:37:40 -0600 Subject: Add deprecation warning for .join().alias() The :meth:`_sql.Join.alias` method is deprecated and will be removed in SQLAlchemy 2.0. An explicit select + subquery, or aliasing of the inner tables, should be used instead. Fixes: #5010 Change-Id: Ic913afc31f0d70b0605f9a7af2742a0de1f9ad19 --- lib/sqlalchemy/testing/assertions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/testing') diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 52a04f9b0..c32b2749b 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -43,7 +43,7 @@ def expect_warnings(*messages, **kw): """ # noqa return _expect_warnings( - (sa_exc.SAWarning, sa_exc.RemovedIn20Warning), messages, **kw + (sa_exc.RemovedIn20Warning, sa_exc.SAWarning), messages, **kw ) @@ -305,7 +305,7 @@ def assert_raises(except_cls, callable_, *args, **kw): def assert_raises_context_ok(except_cls, callable_, *args, **kw): - return _assert_raises(except_cls, callable_, args, kw,) + return _assert_raises(except_cls, callable_, args, kw) def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): @@ -347,7 +347,7 @@ def _expect_raises(except_cls, msg=None, check_context=False): if msg is not None: assert re.search( msg, util.text_type(err), re.UNICODE - ), "%r !~ %s" % (msg, err,) + ), "%r !~ %s" % (msg, err) if check_context and not are_we_already_in_a_traceback: _assert_proper_exception_context(err) print(util.text_type(err).encode("utf-8")) -- cgit v1.2.1