Merge "Ensure the sqla-migrate scripts cache is cleared"

This commit is contained in:
Jenkins 2016-09-16 23:55:16 +00:00 committed by Gerrit Code Review
commit d79d682cfd

View File

@ -36,6 +36,7 @@ import uuid
import migrate
from migrate.versioning import repository
from migrate.versioning import script
import mock
from oslo_db import exception as db_exception
from oslo_db.sqlalchemy import test_base
@ -188,6 +189,11 @@ class SqlMigrateBase(test_base.DbTestCase):
def setUp(self):
super(SqlMigrateBase, self).setUp()
# NOTE(dstanek): Clear out sqlalchemy-migrate's script cache to allow
# us to have multiple repos (expand, migrate, contrate) where the
# modules have the same name (001_awesome.py).
self.addCleanup(script.PythonScript.clear)
# Set keystone's connection URL to be the test engine's url.
database.initialize_sql_session(self.engine.url)