use ..deprecated directive w/ version in all cases

These changes should be ported from 1.3 back to 1.0 or
possibly 0.9 to the extent they are relevant in each
version. In 1.3 we hope to turn all deprecation documentation
into warnings.

(cherry picked from commit 77e9534673d58f2f4c33d16c0ed4e8671cea48b6)
(cherry picked from commit dcfe5a3f8929a11fd8d89b3b34449e1894bb2a3b)

Change-Id: I205186cde161af9389af513a425c62ce90dd54d8
This commit is contained in:
Mike Bayer
2019-01-08 17:46:55 -05:00
parent 6c6b63b26e
commit befe7ffcb8
33 changed files with 442 additions and 209 deletions
+3 -3
View File
@@ -360,7 +360,7 @@ class DDLExecutionTest(fixtures.TestBase):
assert 'xyzzy' in strings
assert 'fnord' in strings
@testing.uses_deprecated(r'See DDLEvents')
@testing.uses_deprecated(r".*use the DDLEvents")
def test_table_by_metadata_deprecated(self):
metadata, users, engine = self.metadata, self.users, self.engine
DDL('mxyzptlk').execute_at('before-create', users)
@@ -462,7 +462,7 @@ class DDLExecutionTest(fixtures.TestBase):
assert 'xyzzy' in strings
assert 'fnord' in strings
@testing.uses_deprecated(r'See DDLEvents')
@testing.uses_deprecated(r".*use the DDLEvents")
def test_metadata_deprecated(self):
metadata, engine = self.metadata, self.engine
@@ -520,7 +520,7 @@ class DDLExecutionTest(fixtures.TestBase):
strings = ' '.join(str(x) for x in pg_mock.mock)
assert 'my_test_constraint' in strings
@testing.uses_deprecated(r'See DDLEvents')
@testing.uses_deprecated(r".*use the DDLEvents")
def test_conditional_constraint_deprecated(self):
metadata, users, engine = self.metadata, self.users, self.engine
nonpg_mock = engines.mock_engine(dialect_name='sqlite')
+8 -2
View File
@@ -772,7 +772,10 @@ class PoolFirstConnectSyncTest(PoolTestBase):
class DeprecatedPoolListenerTest(PoolTestBase):
@testing.requires.predictable_gc
@testing.uses_deprecated(r".*Use event.listen")
@testing.uses_deprecated(
r".*Use the PoolEvents",
r".*'listeners' argument .* is deprecated"
)
def test_listeners(self):
class InstrumentingListener(object):
@@ -960,7 +963,10 @@ class DeprecatedPoolListenerTest(PoolTestBase):
c.close()
snoop.assert_total(1, 1, 2, 2)
@testing.uses_deprecated(r".*Use event.listen")
@testing.uses_deprecated(
r".*Use the PoolEvents",
r".*'listeners' argument .* is deprecated"
)
def test_listeners_callables(self):
def connect(dbapi_con, con_record):
counts[0] += 1
+4 -2
View File
@@ -746,8 +746,10 @@ class ExplicitAutoCommitTest(fixtures.TestBase):
conn1.close()
conn2.close()
@testing.uses_deprecated(r'autocommit on select\(\) is deprecated',
r'``autocommit\(\)`` is deprecated')
@testing.uses_deprecated(
r".*select.autocommit parameter is deprecated",
r".*SelectBase.autocommit\(\) .* is deprecated",
)
def test_explicit_compiled_deprecated(self):
conn1 = testing.db.connect()
conn2 = testing.db.connect()
+2 -1
View File
@@ -13,7 +13,7 @@ from sqlalchemy.orm import create_session, mapper, relationship, \
attributes, instrumentation
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import assert_raises, assert_raises_message
from sqlalchemy.testing import uses_deprecated
class Canary(sa.orm.interfaces.AttributeExtension):
def __init__(self):
@@ -2286,6 +2286,7 @@ class InstrumentationTest(fixtures.ORMTest):
eq_(Sub._sa_iterator(Sub(), 5), "base_iterate")
eq_(Sub._sa_converter(Sub(), 5), "sub_convert")
@uses_deprecated(r".*Please refer to the .*init_collection")
def test_link_event(self):
canary = []