summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-07-16 18:39:07 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-08-10 16:53:45 +0100
commitd949861094d078eaf2d10d72483ac28310d6ec22 (patch)
tree3ca3dc627782e04ab84873daa99d03f4c01e56fa
parent872bc1ddccf85b2a2a571838809130749737e101 (diff)
downloadoslo-db-d949861094d078eaf2d10d72483ac28310d6ec22.tar.gz
Add missing bind argument to calls
Resolve the following RemovedIn20Warning warning: The ``bind`` argument for schema methods that invoke SQL against an engine or connection will be required in SQLAlchemy 2.0. Change-Id: If9492a3842055dde3841eaeb72fb4c050563b6ac Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
-rw-r--r--oslo_db/tests/fixtures.py5
-rw-r--r--oslo_db/tests/sqlalchemy/test_sqlalchemy.py5
2 files changed, 2 insertions, 8 deletions
diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py
index 5f1b299..6b6cad4 100644
--- a/oslo_db/tests/fixtures.py
+++ b/oslo_db/tests/fixtures.py
@@ -39,11 +39,6 @@ class WarningsFixture(fixtures.Fixture):
warnings.filterwarnings(
'once',
- message=r'The ``bind`` argument for schema methods .*',
- category=sqla_exc.SADeprecationWarning)
-
- warnings.filterwarnings(
- 'once',
message=r'The Session.autocommit parameter is deprecated .*',
category=sqla_exc.SADeprecationWarning)
diff --git a/oslo_db/tests/sqlalchemy/test_sqlalchemy.py b/oslo_db/tests/sqlalchemy/test_sqlalchemy.py
index f796368..2d06cfe 100644
--- a/oslo_db/tests/sqlalchemy/test_sqlalchemy.py
+++ b/oslo_db/tests/sqlalchemy/test_sqlalchemy.py
@@ -57,13 +57,12 @@ class RegexpFilterTestCase(db_test_base._DbTestCase):
def setUp(self):
super(RegexpFilterTestCase, self).setUp()
meta = MetaData()
- meta.bind = self.engine
test_table = Table(_REGEXP_TABLE_NAME, meta,
Column('id', Integer, primary_key=True,
nullable=False),
Column('bar', String(255)))
- test_table.create()
- self.addCleanup(test_table.drop)
+ test_table.create(self.engine)
+ self.addCleanup(test_table.drop, self.engine)
def _test_regexp_filter(self, regexp, expected):
with enginefacade.writer.using(db_test_base.context):