Skip to content

Commit b1b3532

Browse files
committed
add decode to stdout
1 parent cd25849 commit b1b3532

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

PyStemmusScope/stemmus_scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _run_sub_process(args: list, cwd):
6161

6262
# TODO return log info line by line!
6363
logger.info(stdout)
64-
return stdout
64+
return stdout.decode('utf-8')
6565

6666

6767
class StemmusScope():

tests/test_stemmus_scope.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_run_exe_file(self, mocked_popen, model_with_setup):
7575
actual_log = (
7676
f"b'Reading config from {actual_cfg_file}\n\n "
7777
"The calculations start now \r\n The calculations end now \r'"
78-
)
78+
).encode()
7979
mocked_popen.return_value.communicate.return_value = (actual_log, "error")
8080
mocked_popen.return_value.wait.return_value = 0
8181

@@ -145,7 +145,7 @@ def test_run_exe_file(self, mocked_popen, model_with_setup, tmp_path):
145145
actual_log = (
146146
f"b'Reading config from {actual_cfg_file}\n\n "
147147
"The calculations start now \r\n The calculations end now \r'"
148-
)
148+
).encode()
149149
mocked_popen.return_value.communicate.return_value = (actual_log, "error")
150150
mocked_popen.return_value.wait.return_value = 0
151151

@@ -192,7 +192,7 @@ def test_run_matlab(self, mocked_popen, model_with_setup, tmp_path):
192192
"b'MATLAB is selecting SOFTWARE OPENGL rendering.\n..."
193193
f"\nReading config from {actual_cfg_file}\n"
194194
"The calculations start now\n The calculations end now\n'"
195-
)
195+
).encode()
196196
mocked_popen.return_value.communicate.return_value = (actual_log, "error")
197197
mocked_popen.return_value.wait.return_value = 0
198198

@@ -240,7 +240,7 @@ def test_run_matlab(self, mocked_popen, model_with_setup, tmp_path):
240240
actual_log = (
241241
f"b'Reading config from {actual_cfg_file}\n"
242242
"The calculations start now\n The calculations end now \n'"
243-
)
243+
).encode()
244244
mocked_popen.return_value.communicate.return_value = (actual_log, "error")
245245
mocked_popen.return_value.wait.return_value = 0
246246

0 commit comments

Comments
 (0)