From 18fb56bf2f7c4780a79e82f839377fac318b2e09 Mon Sep 17 00:00:00 2001 From: ThomasHickman Date: Fri, 8 Sep 2017 14:25:10 +0100 Subject: [PATCH] Make tests compatiable with python 2 Fixes #3 --- gatkcwlgenerator/tests/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gatkcwlgenerator/tests/test.py b/gatkcwlgenerator/tests/test.py index cbde449..56cd9bd 100644 --- a/gatkcwlgenerator/tests/test.py +++ b/gatkcwlgenerator/tests/test.py @@ -27,11 +27,11 @@ def run_command(command, fail_message=None, expect_failure=False): "" if fail_message is None else fail_message + ": ", command, exitcode, - stdout, - stderr + stdout.decode(), + stderr.decode() )) - return CommandOutput(stdout, stderr, exitcode) + return CommandOutput(stdout.decode(), stderr.decode(), exitcode) class CommandOutput(): def __init__(self, stdout, stderr, exitcode): @@ -73,7 +73,7 @@ def run_tool(toolname, extra_info, version, interval=1, filetext=None, expect_fa extra_info += "\nintervals: [chr22:10591400-{}]".format(10591400 + interval) filetext = "analysis_type: {}\n".format(toolname) + default_args + "\n" + extra_info - with tempfile.NamedTemporaryFile() as f: + with tempfile.NamedTemporaryFile("w+") as f: f.write(filetext) f.flush() return run_command("cwl-runner gatk_cmdline_tools/{}/cwl/{}.cwl {}".format(