summaryrefslogtreecommitdiff
path: root/test/lib/ansible_test/_internal
diff options
context:
space:
mode:
authorMatt Clay <mclay@redhat.com>2021-08-11 21:04:42 -0700
committerGitHub <noreply@github.com>2021-08-11 21:04:42 -0700
commit2b463ef19760db5e2e96d15026c41cfa46e2ac6d (patch)
tree0999cd70f9db49d76610b3bb66d08e16c161fa1a /test/lib/ansible_test/_internal
parent5af0420cab320af6ab8587c28f87434cdf1a4ea5 (diff)
downloadansible-2b463ef19760db5e2e96d15026c41cfa46e2ac6d.tar.gz
ansible-test - Upgrade pylint to 2.9.3. (#75480)
* ansible-test - Upgrade `pylint` to 2.9.3. * Update pylint ignores due to rule name change. * Disable pylint deprecated-class for compat code. * Add pylint ignores for test support content. * Add ignores for arguments-renamed in lib/ansible/ * Add pylint ignores for collection_loader. * ansible-test - Ignore deprecations in legacy collection loader. * ansible-test - Suppress pylint consider-using-with * ansible-test - Suppress pylint false positive. * ansible-test - Suppress pylint consider-using-with. * ansible-test - Suppress pylint deprecated-module * Disable some of the new pylint suggestions. * Remove unnecessary six usage from string_format pylint plugin. * Remove obsolete ignore entry.
Diffstat (limited to 'test/lib/ansible_test/_internal')
-rw-r--r--test/lib/ansible_test/_internal/io.py4
-rw-r--r--test/lib/ansible_test/_internal/ssh.py3
-rw-r--r--test/lib/ansible_test/_internal/util.py4
3 files changed, 6 insertions, 5 deletions
diff --git a/test/lib/ansible_test/_internal/io.py b/test/lib/ansible_test/_internal/io.py
index 3ceda56681..1b4fa25acf 100644
--- a/test/lib/ansible_test/_internal/io.py
+++ b/test/lib/ansible_test/_internal/io.py
@@ -73,7 +73,7 @@ def open_text_file(path, mode='r'): # type: (str, str) -> t.TextIO
raise Exception('mode cannot include "b" for text files: %s' % mode)
# noinspection PyTypeChecker
- return io.open(to_bytes(path), mode, encoding=ENCODING)
+ return io.open(to_bytes(path), mode, encoding=ENCODING) # pylint: disable=consider-using-with
def open_binary_file(path, mode='rb'): # type: (str, str) -> t.BinaryIO
@@ -82,7 +82,7 @@ def open_binary_file(path, mode='rb'): # type: (str, str) -> t.BinaryIO
raise Exception('mode must include "b" for binary files: %s' % mode)
# noinspection PyTypeChecker
- return io.open(to_bytes(path), mode)
+ return io.open(to_bytes(path), mode) # pylint: disable=consider-using-with
class SortedSetEncoder(json.JSONEncoder):
diff --git a/test/lib/ansible_test/_internal/ssh.py b/test/lib/ansible_test/_internal/ssh.py
index acc6f5d24d..ed246ea639 100644
--- a/test/lib/ansible_test/_internal/ssh.py
+++ b/test/lib/ansible_test/_internal/ssh.py
@@ -192,7 +192,8 @@ def run_ssh_command(
if args.explain:
process = SshProcess(None)
else:
- process = SshProcess(subprocess.Popen(cmd_bytes, env=env_bytes, bufsize=-1, stdin=devnull(), stdout=subprocess.PIPE, stderr=subprocess.PIPE))
+ process = SshProcess(subprocess.Popen(cmd_bytes, env=env_bytes, bufsize=-1, # pylint: disable=consider-using-with
+ stdin=devnull(), stdout=subprocess.PIPE, stderr=subprocess.PIPE))
return process
diff --git a/test/lib/ansible_test/_internal/util.py b/test/lib/ansible_test/_internal/util.py
index 53274f5ed2..db3daaa4ca 100644
--- a/test/lib/ansible_test/_internal/util.py
+++ b/test/lib/ansible_test/_internal/util.py
@@ -334,7 +334,7 @@ def raw_command(cmd, capture=False, env=None, data=None, cwd=None, explain=False
try:
cmd_bytes = [to_bytes(c) for c in cmd]
env_bytes = dict((to_bytes(k), to_bytes(v)) for k, v in env.items())
- process = subprocess.Popen(cmd_bytes, env=env_bytes, stdin=stdin, stdout=stdout, stderr=stderr, cwd=cwd)
+ process = subprocess.Popen(cmd_bytes, env=env_bytes, stdin=stdin, stdout=stdout, stderr=stderr, cwd=cwd) # pylint: disable=consider-using-with
except OSError as ex:
if ex.errno == errno.ENOENT:
raise ApplicationError('Required program "%s" not found.' % cmd[0])
@@ -837,7 +837,7 @@ def load_module(path, name): # type: (str, str) -> None
sys.modules[name] = module
else:
# noinspection PyDeprecation
- import imp
+ import imp # pylint: disable=deprecated-module
# load_source (and thus load_module) require a file opened with `open` in text mode
with open(to_bytes(path)) as module_file: