change to using py2.7 compat
@@ -14,10 +14,15 @@ class Helpers:
expected_stdout_lines = ['Connected', 'Starting operation', 'Errors: 0']
if expected_stderr_lines is None:
expected_stderr_lines = ['']
- results = subprocess.run(command, shell=True, cwd=cwd, capture_output=True)
- stdout = results.stdout.decode('utf-8')
- stderr = results.stderr.decode('utf-8')
- assert results.returncode == 0
+ results = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, cwd=cwd)
+ returncode = results.wait()
+ stdout, stderr = results.communicate()
+ if type(stdout) is bytes:
+ stdout = stdout.decode('utf-8')
+ if type(stderr) is bytes:
+ stderr = stderr.decode('utf-8')
+ assert returncode == 0
for line in expected_stdout_lines:
print(line)
assert re.search(line, stdout, re.MULTILINE)
