Mixins for tests confuse pylint no end, and aren't necessary... you can stop the base-class from being run as a test by prefixing the class name with an underscore
This commit is contained in:
@@ -43,9 +43,14 @@ from nova.tests.api.openstack import fakes
|
||||
FLAGS = flags.FLAGS
|
||||
|
||||
|
||||
class BaseImageServiceTests(object):
|
||||
class _BaseImageServiceTests(test.TestCase):
|
||||
"""Tasks to test for all image services"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(_BaseImageServiceTests, self).__init__(*args, **kwargs)
|
||||
self.service = None
|
||||
self.context = None
|
||||
|
||||
def test_create(self):
|
||||
fixture = self._make_fixture('test image')
|
||||
num_images = len(self.service.index(self.context))
|
||||
@@ -116,8 +121,7 @@ class BaseImageServiceTests(object):
|
||||
return fixture
|
||||
|
||||
|
||||
class LocalImageServiceTest(test.TestCase,
|
||||
BaseImageServiceTests):
|
||||
class LocalImageServiceTest(_BaseImageServiceTests):
|
||||
|
||||
"""Tests the local image service"""
|
||||
|
||||
@@ -147,8 +151,7 @@ class LocalImageServiceTest(test.TestCase,
|
||||
self.assertEqual(3, len(found_image_ids), len(found_image_ids))
|
||||
|
||||
|
||||
class GlanceImageServiceTest(test.TestCase,
|
||||
BaseImageServiceTests):
|
||||
class GlanceImageServiceTest(_BaseImageServiceTests):
|
||||
|
||||
"""Tests the Glance image service, in particular that metadata translation
|
||||
works properly.
|
||||
|
@@ -80,10 +80,10 @@ class user_and_project_generator(object):
|
||||
self.manager.delete_project(self.project)
|
||||
|
||||
|
||||
class AuthManagerTestCase(object):
|
||||
class _AuthManagerBaseTestCase(test.TestCase):
|
||||
def setUp(self):
|
||||
FLAGS.auth_driver = self.auth_driver
|
||||
super(AuthManagerTestCase, self).setUp()
|
||||
super(_AuthManagerBaseTestCase, self).setUp()
|
||||
self.flags(connection_type='fake')
|
||||
self.manager = manager.AuthManager(new=True)
|
||||
|
||||
@@ -331,11 +331,11 @@ class AuthManagerTestCase(object):
|
||||
self.assertTrue(user.is_admin())
|
||||
|
||||
|
||||
class AuthManagerLdapTestCase(AuthManagerTestCase, test.TestCase):
|
||||
class AuthManagerLdapTestCase(_AuthManagerBaseTestCase):
|
||||
auth_driver = 'nova.auth.ldapdriver.FakeLdapDriver'
|
||||
|
||||
|
||||
class AuthManagerDbTestCase(AuthManagerTestCase, test.TestCase):
|
||||
class AuthManagerDbTestCase(_AuthManagerBaseTestCase):
|
||||
auth_driver = 'nova.auth.dbdriver.DbDriver'
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user