Commit 5ba88688 authored by Jérome Perrin's avatar Jérome Perrin

testnode: python3 fixes

Now that .spawn is called in tests, we can see that
getSupportedParameterList needs to take into account that on python3 the
program output is captured as bytes.
parent d69a48dd
...@@ -617,7 +617,7 @@ shared = true ...@@ -617,7 +617,7 @@ shared = true
parser.add_argument('--hello_world', help='Hello world!') parser.add_argument('--hello_world', help='Hello world!')
def spawn(*args, **kw): def spawn(*args, **kw):
if args[1] == '--help': if args[1] == '--help':
return {'stdout': parser.format_help()} return {'stdout': parser.format_help().encode()}
call_parameter_list.append(args) call_parameter_list.append(args)
test_node = self.getTestNode() test_node = self.getTestNode()
......
...@@ -196,8 +196,9 @@ class ProcessManager(object): ...@@ -196,8 +196,9 @@ class ProcessManager(object):
return result return result
def getSupportedParameterList(self, program_path): def getSupportedParameterList(self, program_path):
return re.findall(r'^ (--\w+)', # type: (str) -> Sequence[str]
self.spawn(program_path, '--help')['stdout'], re.M) return (parameter.decode('utf-8') for parameter in
re.findall(br'^ (--\w+)', self.spawn(program_path, '--help')['stdout'], re.M))
def killall(self, path): def killall(self, path):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment