Removed unnecessary setUp() calls in tests

Basically, if you decide to override a method, that is because you want
to specify(or modify) the behavior of a method. If you just call the
inherited method from the overridden method, that is unnecessary.

Furthermore, every time when self.setUp() is called, now the super's
setUp() is called, which is basically exact the same behavior as
we have now.

TrivialFix

Change-Id: I9f4e03b93ff075c66b4e52342711c37f226d2f81
This commit is contained in:
Gábor Antal 2017-08-02 13:38:43 +02:00
parent e979d19458
commit 98255e6715
9 changed files with 0 additions and 27 deletions

View File

@ -27,9 +27,6 @@ from manila.tests import db_utils
class ShareTestCase(test.TestCase):
"""Testing of SQLAlchemy Share model class."""
def setUp(self):
super(ShareTestCase, self).setUp()
@ddt.data(constants.STATUS_MANAGE_ERROR, constants.STATUS_CREATING,
constants.STATUS_EXTENDING, constants.STATUS_DELETING,
constants.STATUS_EXTENDING_ERROR,

View File

@ -30,9 +30,6 @@ CONF = cfg.CONF
class SchedulerRpcAPITestCase(test.TestCase):
def setUp(self):
super(SchedulerRpcAPITestCase, self).setUp()
def tearDown(self):
super(SchedulerRpcAPITestCase, self).tearDown()

View File

@ -27,9 +27,6 @@ from manila import test
class UtilsTestCase(test.TestCase):
"""Test case for utils."""
def setUp(self):
super(UtilsTestCase, self).setUp()
@ddt.data(
({'extra_specs': {'thin_provisioning': True}}, True),
({'extra_specs': {'thin_provisioning': False}}, False),

View File

@ -30,9 +30,6 @@ from manila.tests.share.drivers.hpe import test_hpe_3par_constants as constants
@ddt.ddt
class HPE3ParDriverFPGTestCase(test.TestCase):
def setUp(self):
super(HPE3ParDriverFPGTestCase, self).setUp()
@ddt.data((-1, 4),
(0, 5),
(0, -1))

View File

@ -25,9 +25,6 @@ from manila.tests.share.drivers.netapp import fakes as na_fakes
class NetAppDriverFactoryTestCase(test.TestCase):
def setUp(self):
super(NetAppDriverFactoryTestCase, self).setUp()
def test_new(self):
self.mock_object(na_utils.OpenStackInfo, 'info',

View File

@ -162,9 +162,6 @@ class OpenstackInfoTestCase(test.TestCase):
DEB_RLS = 'upstream_version-debian_revision'
DEB_VENDOR = 'debian_revision'
def setUp(self):
super(OpenstackInfoTestCase, self).setUp()
def test_openstack_info_init(self):
info = na_utils.OpenStackInfo()

View File

@ -28,9 +28,6 @@ CONF.register_opt(cfg.StrOpt('conf_unittest',
class ConfigTestCase(test.TestCase):
def setUp(self):
super(ConfigTestCase, self).setUp()
def test_declare(self):
self.assertNotIn('answer', CONF)
CONF.import_opt('answer', 'manila.tests.declare_conf')

View File

@ -21,9 +21,6 @@ from manila import test
@ddt.ddt
class RPCTestCase(test.TestCase):
def setUp(self):
super(RPCTestCase, self).setUp()
@ddt.data([], ['noop'], ['noop', 'noop'])
@mock.patch('oslo_messaging.JsonPayloadSerializer', wraps=True)
def test_init_no_notifications(self, driver, serializer_mock):

View File

@ -525,9 +525,6 @@ class TestComparableMixin(test.TestCase):
class TestRetryDecorator(test.TestCase):
def setUp(self):
super(TestRetryDecorator, self).setUp()
def test_no_retry_required(self):
self.counter = 0