Fix the order of base classes in DB test cases

Next release of oslo.db is going to break Tuskar DB tests: when
a test case cleanup is run, it fails to fetch 'schema' attribute of
oslo.db base test case, set in its setup. The problem is that Tuskar
base test case intentionally removes all attributes from a test case
class instance in its cleanup callback (to ensure there are no memory
leaks).

So in order for Tuskar unit tests to work correctly with new release
of oslo.db we need either to remove inheritance from Tuskar base test
case or to change the order of base classes to achieve the 'proper'
MRO for DB test cases.

In future, oslo.db is going to introduce a DB fixture instead of a
base test case class to avoid such problems with multiple inheritance.

Change-Id: Ia0ca1b261d707b6fbe349fd536599c845da0a2e9
This commit is contained in:
Roman Podoliaka 2015-02-25 15:09:27 +02:00
parent febd5cdfb9
commit 3112eaff04
1 changed files with 12 additions and 12 deletions

View File

@ -37,32 +37,32 @@ class VersionStoreSQLAlchemyTestCase(SQLAlchemyTestCase,
pass
class MySQLBaseStoreTestCase(BaseStoreSQLAlchemyTestCase,
test_base.MySQLOpportunisticTestCase):
class MySQLBaseStoreTestCase(test_base.MySQLOpportunisticTestCase,
BaseStoreSQLAlchemyTestCase):
pass
class MySQLNamedStoreTestCase(NamedStoreSQLAlchemyTestCase,
test_base.MySQLOpportunisticTestCase):
class MySQLNamedStoreTestCase(test_base.MySQLOpportunisticTestCase,
NamedStoreSQLAlchemyTestCase):
pass
class MySQLVersionedStoreTestCase(VersionStoreSQLAlchemyTestCase,
test_base.MySQLOpportunisticTestCase):
class MySQLVersionedStoreTestCase(test_base.MySQLOpportunisticTestCase,
VersionStoreSQLAlchemyTestCase):
pass
class PostgreSQLBaseStoreTestCase(BaseStoreSQLAlchemyTestCase,
test_base.PostgreSQLOpportunisticTestCase):
class PostgreSQLBaseStoreTestCase(test_base.PostgreSQLOpportunisticTestCase,
BaseStoreSQLAlchemyTestCase):
pass
class PostgreSQLNamedStoreTestCase(NamedStoreSQLAlchemyTestCase,
test_base.PostgreSQLOpportunisticTestCase):
class PostgreSQLNamedStoreTestCase(test_base.PostgreSQLOpportunisticTestCase,
NamedStoreSQLAlchemyTestCase):
pass
class PostgreSQLVersionedStoreTestCase(
VersionStoreSQLAlchemyTestCase,
test_base.PostgreSQLOpportunisticTestCase):
test_base.PostgreSQLOpportunisticTestCase,
VersionStoreSQLAlchemyTestCase):
pass