Use oslo_db.sqlalchemy.test_fixtures

The change in Idfab443dba26e94d9e50814cf7ffc5624748b476
makes use of oslo_db.tests.*, which was not the intent of the
deprecations added to oslo_db in
I0163e637ffef6d45d2573ebe29b5438911d01fce.   Make use of the
newer fixtures in oslo_db.sqlalchemy.test_fixtures which is
what was intended to supersede oslo_db.sqlalchemy.test_base.

Change-Id: Iff0c77f60c4e8b48c56d165653b1d27295d0aa2e
This commit is contained in:
Mike Bayer 2018-02-19 11:25:34 -05:00
parent 5ae619605c
commit 6682a3d1c7

View File

@ -42,11 +42,12 @@ import fixtures
import mock
from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import enginefacade
from oslo_db.sqlalchemy import test_fixtures
from oslo_db.sqlalchemy import test_migrations
from oslo_db.sqlalchemy import utils as db_utils
from oslo_db.tests.sqlalchemy import base as test_base
from oslo_log import log as logging
from oslo_utils import uuidutils
from oslotest import base as test_base
import sqlalchemy
import sqlalchemy.exc
@ -182,6 +183,7 @@ class MigrationCheckersMixin(object):
def setUp(self):
super(MigrationCheckersMixin, self).setUp()
self.engine = enginefacade.writer.get_engine()
self.config = migration._alembic_config()
self.migration_api = migration
self.useFixture(fixtures.Timeout(MIGRATIONS_TIMEOUT,
@ -692,20 +694,23 @@ class MigrationCheckersMixin(object):
class TestMigrationsMySQL(MigrationCheckersMixin,
WalkVersionsMixin,
test_base.MySQLOpportunisticTestCase):
pass
test_fixtures.OpportunisticDBTestMixin,
test_base.BaseTestCase):
FIXTURE = test_fixtures.MySQLOpportunisticFixture
class TestMigrationsPostgreSQL(MigrationCheckersMixin,
WalkVersionsMixin,
test_base.PostgreSQLOpportunisticTestCase):
pass
test_fixtures.OpportunisticDBTestMixin,
test_base.BaseTestCase):
FIXTURE = test_fixtures.PostgresqlOpportunisticFixture
class ModelsMigrationSyncMixin(object):
def setUp(self):
super(ModelsMigrationSyncMixin, self).setUp()
self.engine = enginefacade.writer.get_engine()
self.useFixture(fixtures.Timeout(MIGRATIONS_TIMEOUT,
gentle=True))
@ -722,11 +727,13 @@ class ModelsMigrationSyncMixin(object):
class ModelsMigrationsSyncMysql(ModelsMigrationSyncMixin,
test_migrations.ModelsMigrationsSync,
test_base.MySQLOpportunisticTestCase):
pass
test_fixtures.OpportunisticDBTestMixin,
test_base.BaseTestCase):
FIXTURE = test_fixtures.MySQLOpportunisticFixture
class ModelsMigrationsSyncPostgres(ModelsMigrationSyncMixin,
test_migrations.ModelsMigrationsSync,
test_base.PostgreSQLOpportunisticTestCase):
pass
test_fixtures.OpportunisticDBTestMixin,
test_base.BaseTestCase):
FIXTURE = test_fixtures.PostgresqlOpportunisticFixture