diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-12-30 18:24:37 -0500 |
---|---|---|
committer | Roman Podoliaka <rpodolyaka@mirantis.com> | 2015-02-04 12:49:01 +0200 |
commit | 6ccea346d9609d47b188b33c686f49ce3f4f9b14 (patch) | |
tree | d2cd0fa828a3a3207767a7400de33af6ea529952 /oslo_db/sqlalchemy/test_migrations.py | |
parent | aa6fc4e2bd985c8a115de53f958ad16256a90243 (diff) | |
download | oslo-db-6ccea346d9609d47b188b33c686f49ce3f4f9b14.tar.gz |
Organize provisioning to use testresources
This change introduces the use of the testresources package,
such that the provisioning system uses TestResourceManager
objects in order to create and drop databases, schemas,
and manage transactional testing. A new series of objects
to support transparent transaction containers within
tests is added as well.
partially implement bp: long-lived-transactionalized-db-fixtures
Partial-Bug: #1339206
Change-Id: I16bfa3af0e1ad6a9231ea38dea7cd76092347f55
Diffstat (limited to 'oslo_db/sqlalchemy/test_migrations.py')
-rw-r--r-- | oslo_db/sqlalchemy/test_migrations.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/oslo_db/sqlalchemy/test_migrations.py b/oslo_db/sqlalchemy/test_migrations.py index 7627d21..2f9372e 100644 --- a/oslo_db/sqlalchemy/test_migrations.py +++ b/oslo_db/sqlalchemy/test_migrations.py @@ -16,6 +16,7 @@ import abc import collections +import functools import logging import pprint @@ -483,9 +484,6 @@ class ModelsMigrationsSync(object): return meta_def != insp_def return insp_def != "'%s'::character varying" % meta_def.arg - def _cleanup(self): - self.provision.drop_all_objects() - FKInfo = collections.namedtuple('fk_info', ['constrained_columns', 'referred_table', 'referred_columns']) @@ -567,7 +565,8 @@ class ModelsMigrationsSync(object): ' for running of this test: %s' % e) # 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()) |