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
parser.add_argument('--hello_world', help='Hello world!')
def spawn(*args, **kw):
if args[1] == '--help':
return {'stdout': parser.format_help()}
return {'stdout': parser.format_help().encode()}
call_parameter_list.append(args)
test_node = self.getTestNode()
......
......@@ -196,8 +196,9 @@ class ProcessManager(object):
return result
def getSupportedParameterList(self, program_path):
return re.findall(r'^ (--\w+)',
self.spawn(program_path, '--help')['stdout'], re.M)
# type: (str) -> Sequence[str]
return (parameter.decode('utf-8') for parameter in
re.findall(br'^ (--\w+)', self.spawn(program_path, '--help')['stdout'], re.M))
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