From 6b0a98563ca1e22b006df8cd5bc0e6dbde999bc0 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Thu, 26 Feb 2015 10:33:19 +0000 Subject: [PATCH] Correct db functional tests to support oslo.db 1.50 Currently test_migrations[1] uses _cleanup private method defined in oslo_db.sqlalchemy.test_migrations which has been removed in oslo.db 1.5.0. This change corrects test_migrations[1] based on oslo.db change I16bfa3af0e1ad6a9231ea38dea7cd76092347f55. [1] neutron.tests.functional.db package Change-Id: I35676ca2e5900d7fd95a11d6c7dd3ad1c9a686e2 Closes-Bug: #1425890 --- neutron/tests/functional/db/test_migrations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neutron/tests/functional/db/test_migrations.py b/neutron/tests/functional/db/test_migrations.py index 05d1fac1d..63857fb98 100644 --- a/neutron/tests/functional/db/test_migrations.py +++ b/neutron/tests/functional/db/test_migrations.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +import functools import logging import pprint @@ -156,7 +157,8 @@ class _TestModelsMigrations(test_migrations.ModelsMigrationsSync): def test_models_sync(self): # drop all tables after a test run - self.addCleanup(self._cleanup) + self.addCleanup(functools.partial(self.db.backend.drop_all_objects, + self.get_engine())) # run migration scripts self.db_sync(self.get_engine()) -- 2.45.2