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>
This commit is contained in:
Stephen Finucane 2021-07-16 18:39:07 +01:00
parent 872bc1ddcc
commit d949861094
2 changed files with 2 additions and 8 deletions

View File

@ -37,11 +37,6 @@ class WarningsFixture(fixtures.Fixture):
# ...but filter everything out until we get around to fixing them
# FIXME(stephenfin): Remove all of these
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 .*',

View File

@ -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):