summaryrefslogtreecommitdiffstats
path: root/test/units/module_utils/basic
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/module_utils/basic')
-rw-r--r--test/units/module_utils/basic/test_exit_json.py12
-rw-r--r--test/units/module_utils/basic/test_log.py6
-rw-r--r--test/units/module_utils/basic/test_run_command.py2
-rw-r--r--test/units/module_utils/basic/test_tmpdir.py2
4 files changed, 5 insertions, 17 deletions
diff --git a/test/units/module_utils/basic/test_exit_json.py b/test/units/module_utils/basic/test_exit_json.py
index ef44cecfa0..795e9c1eb6 100644
--- a/test/units/module_utils/basic/test_exit_json.py
+++ b/test/units/module_utils/basic/test_exit_json.py
@@ -33,8 +33,6 @@ class TestAnsibleModuleExitJson:
{'msg': 'message', 'datetime': DATETIME.isoformat(), 'invocation': EMPTY_INVOCATION}),
)
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
- # pylint: disable=undefined-variable
@pytest.mark.parametrize('args, expected, stdin', ((a, e, {}) for a, e in DATA), indirect=['stdin'])
def test_exit_json_exits(self, am, capfd, args, expected, monkeypatch):
monkeypatch.setattr(warnings, '_global_deprecations', [])
@@ -47,10 +45,8 @@ class TestAnsibleModuleExitJson:
return_val = json.loads(out)
assert return_val == expected
- # Fail_json is only legal if it's called with a message
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
@pytest.mark.parametrize('args, expected, stdin',
- ((a, e, {}) for a, e in DATA if 'msg' in a), # pylint: disable=undefined-variable
+ ((a, e, {}) for a, e in DATA if 'msg' in a),
indirect=['stdin'])
def test_fail_json_exits(self, am, capfd, args, expected, monkeypatch):
monkeypatch.setattr(warnings, '_global_deprecations', [])
@@ -141,10 +137,9 @@ class TestAnsibleModuleExitValuesRemoved:
),
)
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
@pytest.mark.parametrize('am, stdin, return_val, expected',
(({'username': {}, 'password': {'no_log': True}, 'token': {'no_log': True}}, s, r, e)
- for s, r, e in DATA), # pylint: disable=undefined-variable
+ for s, r, e in DATA),
indirect=['am', 'stdin'])
def test_exit_json_removes_values(self, am, capfd, return_val, expected, monkeypatch):
monkeypatch.setattr(warnings, '_global_deprecations', [])
@@ -154,10 +149,9 @@ class TestAnsibleModuleExitValuesRemoved:
assert json.loads(out) == expected
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
@pytest.mark.parametrize('am, stdin, return_val, expected',
(({'username': {}, 'password': {'no_log': True}, 'token': {'no_log': True}}, s, r, e)
- for s, r, e in DATA), # pylint: disable=undefined-variable
+ for s, r, e in DATA),
indirect=['am', 'stdin'])
def test_fail_json_removes_values(self, am, capfd, return_val, expected, monkeypatch):
monkeypatch.setattr(warnings, '_global_deprecations', [])
diff --git a/test/units/module_utils/basic/test_log.py b/test/units/module_utils/basic/test_log.py
index 59fde23fa2..5b423495c5 100644
--- a/test/units/module_utils/basic/test_log.py
+++ b/test/units/module_utils/basic/test_log.py
@@ -16,8 +16,7 @@ class TestAnsibleModuleLogSmokeTest:
DATA = DATA + [d.encode('utf-8') for d in DATA]
DATA += [b'non-utf8 :\xff: test']
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
- @pytest.mark.parametrize('msg, stdin', ((m, {}) for m in DATA), indirect=['stdin']) # pylint: disable=undefined-variable
+ @pytest.mark.parametrize('msg, stdin', ((m, {}) for m in DATA), indirect=['stdin'])
def test_smoketest_syslog(self, am, mocker, msg):
# These talk to the live daemons on the system. Need to do this to
# show that what we send doesn't cause an issue once it gets to the
@@ -55,9 +54,8 @@ class TestAnsibleModuleLogSyslog:
else:
mock_syslog.assert_called_once_with(syslog.LOG_INFO, 'unittest no_log')
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
@pytest.mark.parametrize('msg, param, stdin',
- ((m, p, {}) for m, p in OUTPUT_DATA), # pylint: disable=undefined-variable
+ ((m, p, {}) for m, p in OUTPUT_DATA),
indirect=['stdin'])
def test_output_matches(self, am, mocker, msg, param):
"""Check that log messages are sent correctly"""
diff --git a/test/units/module_utils/basic/test_run_command.py b/test/units/module_utils/basic/test_run_command.py
index 2f77d5f374..c00ec27187 100644
--- a/test/units/module_utils/basic/test_run_command.py
+++ b/test/units/module_utils/basic/test_run_command.py
@@ -126,8 +126,6 @@ class TestRunCommandArgs:
('/bin/ls a " b" "c "', [b'/bin/ls', b'a', b' b', b'c '], b'/bin/ls a " b" "c "'),
)
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
- # pylint: disable=undefined-variable
@pytest.mark.parametrize('cmd, expected, shell, stdin',
((arg, cmd_str if sh else cmd_lst, sh, {})
for (arg, cmd_lst, cmd_str), sh in product(ARGS_DATA, (True, False))),
diff --git a/test/units/module_utils/basic/test_tmpdir.py b/test/units/module_utils/basic/test_tmpdir.py
index 65d6801127..aa77c9c695 100644
--- a/test/units/module_utils/basic/test_tmpdir.py
+++ b/test/units/module_utils/basic/test_tmpdir.py
@@ -57,8 +57,6 @@ class TestAnsibleModuleTmpDir:
),
)
- # pylint bug: https://github.com/PyCQA/pylint/issues/511
- # pylint: disable=undefined-variable
@pytest.mark.parametrize('args, expected, stat_exists', ((s, e, t) for s, t, e in DATA))
def test_tmpdir_property(self, monkeypatch, args, expected, stat_exists):
makedirs = {'called': False}