Code cleanup to prepare for pylint update. (#75475)
* user - Remove unused code. * Replace deprecated abstractproperty decorator. * Fix __all__ to be a tuple. * Use a generator in subelements lookup. * Use from import in basic.py * Add changelog fragment. * Fix selinux unit test.
This commit is contained in:
@ -43,10 +43,10 @@ class TestImports(ModuleTestCase):
|
||||
|
||||
@patch.object(builtins, '__import__')
|
||||
def test_module_utils_basic_import_selinux(self, mock_import):
|
||||
def _mock_import(name, *args, **kwargs):
|
||||
if name == 'ansible.module_utils.compat.selinux':
|
||||
def _mock_import(name, globals=None, locals=None, fromlist=tuple(), level=0, **kwargs):
|
||||
if name == 'ansible.module_utils.compat' and fromlist == ('selinux',):
|
||||
raise ImportError
|
||||
return realimport(name, *args, **kwargs)
|
||||
return realimport(name, globals=globals, locals=locals, fromlist=fromlist, level=level, **kwargs)
|
||||
|
||||
try:
|
||||
self.clear_modules(['ansible.module_utils.compat.selinux', 'ansible.module_utils.basic'])
|
||||
|
||||
Reference in New Issue
Block a user