Fix pointless statements in unit tests (#79940)

pull/79943/head
Matt Clay 2 years ago committed by GitHub
parent fa1564c548
commit 1ba100a3b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -69,10 +69,10 @@ class TestHost(unittest.TestCase):
def test_equals_none(self):
other = None
self.hostA == other
other == self.hostA
self.hostA != other
other != self.hostA
assert not (self.hostA == other)
assert not (other == self.hostA)
assert self.hostA != other
assert other != self.hostA
self.assertNotEqual(self.hostA, other)
def test_serialize(self):

@ -139,7 +139,7 @@ def function_other_timeout():
@timeout.timeout(1)
def function_raises():
1 / 0
return 1 / 0
@timeout.timeout(1)

@ -58,7 +58,7 @@ def test_pause_missing_curses(mocker, monkeypatch):
mod = importlib.import_module('ansible.plugins.action.pause')
with pytest.raises(AttributeError):
mod.curses
mod.curses # pylint: disable=pointless-statement
assert mod.HAS_CURSES is False
assert mod.MOVE_TO_BOL == b'\r'

@ -66,7 +66,7 @@ class TestCachePluginAdjudicator(unittest.TestCase):
def test___getitem__(self):
with pytest.raises(KeyError):
self.cache['foo']
self.cache['foo'] # pylint: disable=pointless-statement
def test_pop_with_default(self):
assert self.cache.pop('foo', 'bar') == 'bar'

@ -91,12 +91,12 @@ def test_wrap_var_no_ref():
'text': 'text',
}
wrapped_thing = wrap_var(thing)
thing is not wrapped_thing
thing['foo'] is not wrapped_thing['foo']
thing['bar'][0] is not wrapped_thing['bar'][0]
thing['baz'][0] is not wrapped_thing['baz'][0]
thing['none'] is not wrapped_thing['none']
thing['text'] is not wrapped_thing['text']
assert thing is not wrapped_thing
assert thing['foo'] is not wrapped_thing['foo']
assert thing['bar'][0] is not wrapped_thing['bar'][0]
assert thing['baz'][0] is not wrapped_thing['baz'][0]
assert thing['none'] is wrapped_thing['none']
assert thing['text'] is not wrapped_thing['text']
def test_AnsibleUnsafeText():

@ -141,10 +141,8 @@ class TestVariableManager(unittest.TestCase):
return
# pylint: disable=unreachable
'''
Tests complex variations and combinations of get_vars() with different
objects to modify the context under which variables are merged.
'''
# Tests complex variations and combinations of get_vars() with different
# objects to modify the context under which variables are merged.
# FIXME: BCS makethiswork
# return True

Loading…
Cancel
Save