connection = local_connection
users = self.tables.users
connection.begin()
- branched = connection.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ branched = connection.connect()
assert branched.in_transaction()
branched.execute(users.insert(), dict(user_id=1, user_name="user1"))
with testing.expect_deprecated_20(
def test_branch_autorollback(self, local_connection):
connection = local_connection
users = self.tables.users
- branched = connection.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ branched = connection.connect()
with testing.expect_deprecated_20(
"The current statement is being autocommitted using "
"implicit autocommit"
def test_branch_orig_rollback(self, local_connection):
connection = local_connection
users = self.tables.users
- branched = connection.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ branched = connection.connect()
with testing.expect_deprecated_20(
"The current statement is being autocommitted using "
"implicit autocommit"
def test_branch_autocommit(self, local_connection):
users = self.tables.users
with testing.db.connect() as connection:
- branched = connection.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ branched = connection.connect()
with testing.expect_deprecated_20(
"The current statement is being autocommitted using "
"implicit autocommit"
connection = local_connection
users = self.tables.users
trans = connection.begin()
- branched = connection.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ branched = connection.connect()
assert branched.in_transaction()
branched.execute(users.insert(), dict(user_id=1, user_name="user1"))
nested = branched.begin_nested()
def test_branch_twophase_rollback(self, local_connection):
connection = local_connection
users = self.tables.users
- branched = connection.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ branched = connection.connect()
assert not branched.in_transaction()
with testing.expect_deprecated_20(
r"The current statement is being autocommitted using "
with self.engine.connect() as c1:
with patch.object(self.engine.pool, "logger") as logger:
- c1_branch = c1.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ c1_branch = c1.connect()
eq_(c1_branch.execute(select(1)).scalar(), 1)
self.engine.test_shutdown()
def test_branched_invalidate_parent_to_branch(self):
with self.engine.connect() as c1:
-
- c1_branch = c1.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ c1_branch = c1.connect()
eq_(c1_branch.execute(select(1)).scalar(), 1)
self.engine.test_shutdown()
def test_branch_invalidate_state(self):
with self.engine.connect() as c1:
-
- c1_branch = c1.connect()
+ with testing.expect_deprecated_20(
+ r"The Connection.connect\(\) method is considered legacy"
+ ):
+ c1_branch = c1.connect()
eq_(c1_branch.execute(select(1)).scalar(), 1)