1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-01 18:06:25 +00:00

Cleanup: use super() instead of super(__class__, self) (#11016)

* Address UP008: Use super() instead of super(__class__, self).

* Linting.
This commit is contained in:
Felix Fontein 2025-10-30 20:17:26 +01:00 committed by GitHub
parent 0c5466de47
commit 74c2c804e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
204 changed files with 390 additions and 401 deletions

View file

@ -12,7 +12,7 @@ from ansible_collections.community.general.plugins.module_utils.hwc_utils import
class HwcUtilsTestCase(unittest.TestCase):
def setUp(self):
super(HwcUtilsTestCase, self).setUp()
super().setUp()
# Add backward compatibility
if sys.version_info < (3, 0):

View file

@ -340,7 +340,7 @@ class PritunlDeleteUserMock(MagicMock):
class ModuleFailException(Exception):
def __init__(self, msg, **kwargs):
super(ModuleFailException, self).__init__(msg)
super().__init__(msg)
self.fail_msg = msg
self.fail_kwargs = kwargs

View file

@ -79,7 +79,7 @@ def mock_xenapi_failure(XenAPI, mocker):
# same side_effect as its parent mock object.
class MagicMockSideEffect(MagicMock):
def _get_child_mock(self, **kw):
child_mock = super(MagicMockSideEffect, self)._get_child_mock(**kw)
child_mock = super()._get_child_mock(**kw)
child_mock.side_effect = self.side_effect
return child_mock