Cleanup for Python 3.9 and pycodestyle compat.

pull/69463/head
Matt Clay 4 years ago
parent d8e0aadc0d
commit d0484fbf74

@ -88,7 +88,7 @@ class TaskResult:
ret = True
elif _debugger in ('on_unreachable',) and self.is_unreachable():
ret = True
elif _debugger in('on_skipped',) and self.is_skipped():
elif _debugger in ('on_skipped',) and self.is_skipped():
ret = True
return ret

@ -108,7 +108,7 @@ class RoleRequirement(RoleDefinition):
else:
role = role.copy()
if 'src'in role:
if 'src' in role:
# New style: { src: 'galaxy.role,version,name', other_vars: "here" }
if 'github.com' in role["src"] and 'http' in role["src"] and '+' not in role["src"] and not role["src"].endswith('.tar.gz'):
role["src"] = "git+" + role["src"]

@ -48,13 +48,13 @@ class TestBoolean:
def test_junk_values_strict(self):
with pytest.raises(TypeError):
assert boolean("flibbity", strict=True)is False
assert boolean("flibbity", strict=True) is False
with pytest.raises(TypeError):
assert boolean(42, strict=True)is False
assert boolean(42, strict=True) is False
with pytest.raises(TypeError):
assert boolean(42.0, strict=True)is False
assert boolean(42.0, strict=True) is False
with pytest.raises(TypeError):
assert boolean(object(), strict=True)is False
assert boolean(object(), strict=True) is False

@ -157,7 +157,7 @@ def test_fetch_url_nossl(open_url_mock, fake_ansible_module, mocker):
fetch_url(fake_ansible_module, 'http://ansible.com/')
assert 'python-ssl' in excinfo.value.kwargs['msg']
assert'http://ansible.com/' == excinfo.value.kwargs['url']
assert 'http://ansible.com/' == excinfo.value.kwargs['url']
assert excinfo.value.kwargs['status'] == -1
@ -167,7 +167,7 @@ def test_fetch_url_connectionerror(open_url_mock, fake_ansible_module):
fetch_url(fake_ansible_module, 'http://ansible.com/')
assert excinfo.value.kwargs['msg'] == 'TESTS'
assert'http://ansible.com/' == excinfo.value.kwargs['url']
assert 'http://ansible.com/' == excinfo.value.kwargs['url']
assert excinfo.value.kwargs['status'] == -1
open_url_mock.side_effect = ValueError('TESTS')
@ -175,7 +175,7 @@ def test_fetch_url_connectionerror(open_url_mock, fake_ansible_module):
fetch_url(fake_ansible_module, 'http://ansible.com/')
assert excinfo.value.kwargs['msg'] == 'TESTS'
assert'http://ansible.com/' == excinfo.value.kwargs['url']
assert 'http://ansible.com/' == excinfo.value.kwargs['url']
assert excinfo.value.kwargs['status'] == -1

Loading…
Cancel
Save