Merge pull request #8197 from aabadie/pr/tests/python_E711
tests/lwip: fix python E711 comparison to None should be 'if cond is not None:'
This commit is contained in:
commit
ae8b426897
@ -20,7 +20,7 @@ DEFAULT_TIMEOUT = 5
|
||||
|
||||
class Strategy(object):
|
||||
def __init__(self, func=None):
|
||||
if func != None:
|
||||
if func is not None:
|
||||
if sys.version_info < (3,):
|
||||
self.__class__.execute = types.MethodType(func, self, self.__class__)
|
||||
else:
|
||||
@ -43,7 +43,7 @@ class BoardStrategy(Strategy):
|
||||
|
||||
def __run_make(self, application, make_targets, env=None):
|
||||
env = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env.update(env)
|
||||
env.update(self.board.to_env())
|
||||
cmd = ("make", "-C", application) + make_targets
|
||||
@ -81,7 +81,7 @@ class Board(object):
|
||||
def _reset_native_execute(obj, application, env=None, *args, **kwargs):
|
||||
pass
|
||||
|
||||
if (name == "native") and (reset == None):
|
||||
if (name == "native") and (reset is None):
|
||||
reset = _reset_native_execute
|
||||
|
||||
self.name = name
|
||||
@ -161,7 +161,7 @@ class BoardGroup(object):
|
||||
def default_test_case(board_group, application, env=None):
|
||||
for board in board_group:
|
||||
env = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env.update(env)
|
||||
env.update(board.to_env())
|
||||
with pexpect.spawnu("make", ["-C", application, "term"], env=env,
|
||||
@ -191,11 +191,11 @@ def get_ipv6_address(spawn):
|
||||
|
||||
def test_ipv6_send(board_group, application, env=None):
|
||||
env_sender = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_sender.update(env)
|
||||
env_sender.update(board_group.boards[0].to_env())
|
||||
env_receiver = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_receiver.update(env)
|
||||
env_receiver.update(board_group.boards[1].to_env())
|
||||
with pexpect.spawnu("make", ["-C", application, "term"], env=env_sender,
|
||||
@ -215,11 +215,11 @@ def test_ipv6_send(board_group, application, env=None):
|
||||
|
||||
def test_udpv6_send(board_group, application, env=None):
|
||||
env_sender = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_sender.update(env)
|
||||
env_sender.update(board_group.boards[0].to_env())
|
||||
env_receiver = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_receiver.update(env)
|
||||
env_receiver.update(board_group.boards[1].to_env())
|
||||
with pexpect.spawnu("make", ["-C", application, "term"], env=env_sender,
|
||||
@ -240,11 +240,11 @@ def test_udpv6_send(board_group, application, env=None):
|
||||
|
||||
def test_tcpv6_send(board_group, application, env=None):
|
||||
env_client = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_client.update(env)
|
||||
env_client.update(board_group.boards[0].to_env())
|
||||
env_server = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_server.update(env)
|
||||
env_server.update(board_group.boards[1].to_env())
|
||||
with pexpect.spawnu("make", ["-C", application, "term"], env=env_client,
|
||||
@ -270,11 +270,11 @@ def test_tcpv6_send(board_group, application, env=None):
|
||||
|
||||
def test_triple_send(board_group, application, env=None):
|
||||
env_sender = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_sender.update(env)
|
||||
env_sender.update(board_group.boards[0].to_env())
|
||||
env_receiver = os.environ.copy()
|
||||
if env != None:
|
||||
if env is not None:
|
||||
env_receiver.update(env)
|
||||
env_receiver.update(board_group.boards[1].to_env())
|
||||
with pexpect.spawnu("make", ["-C", application, "term"], env=env_sender,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user