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): def test_equals_none(self):
other = None other = None
self.hostA == other assert not (self.hostA == other)
other == self.hostA assert not (other == self.hostA)
self.hostA != other assert self.hostA != other
other != self.hostA assert other != self.hostA
self.assertNotEqual(self.hostA, other) self.assertNotEqual(self.hostA, other)
def test_serialize(self): def test_serialize(self):

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

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

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

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

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

Loading…
Cancel
Save