diff options
author | Stephen Finucane <stephenfin@redhat.com> | 2021-08-16 12:53:46 +0100 |
---|---|---|
committer | Stephen Finucane <stephenfin@redhat.com> | 2022-02-08 14:40:36 +0000 |
commit | 6ecce8996188a63ba18c607dd10dd58c9c21f2b8 (patch) | |
tree | 5d4a3ce06dfc57d12bd8afcd639c904776794963 /oslo_db/tests/sqlalchemy/test_utils.py | |
parent | 22c602f075795b6d5ecbbc2e229817f759613ea2 (diff) | |
download | oslo-db-6ecce8996188a63ba18c607dd10dd58c9c21f2b8.tar.gz |
Don't call 'begin()' on existing transaction
Resolve the following RemovedIn20Warning warning:
Calling .begin() when a transaction is already begun, creating a 'sub'
transaction, is deprecated and will be removed in 2.0. See the
documentation section 'Migrating from the nesting pattern' for
background on how to migrate from this pattern.
Change-Id: I59e45dfea8fcbf72fc6e34345e510554cbdd138e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'oslo_db/tests/sqlalchemy/test_utils.py')
-rw-r--r-- | oslo_db/tests/sqlalchemy/test_utils.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/oslo_db/tests/sqlalchemy/test_utils.py b/oslo_db/tests/sqlalchemy/test_utils.py index 087f7ec..27ed640 100644 --- a/oslo_db/tests/sqlalchemy/test_utils.py +++ b/oslo_db/tests/sqlalchemy/test_utils.py @@ -700,8 +700,7 @@ class TestMigrationUtils(db_test_base._DbTestCase): test_table.create(engine) with engine.connect() as conn, conn.begin(): - with conn.begin(): - conn.execute(test_table.insert(), values) + conn.execute(test_table.insert(), values) return test_table, values def test_drop_old_duplicate_entries_from_table(self): |