From 02fcda7ccad66962ab50f0fc78c4395a84a8fd54 Mon Sep 17 00:00:00 2001 From: samueldsr8 Date: Sat, 12 Mar 2022 08:17:39 -0500 Subject: [PATCH] fix: Fix utils for tests --- tests/utils/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/utils/utils.py b/tests/utils/utils.py index 961cf7cbc..37a503aad 100644 --- a/tests/utils/utils.py +++ b/tests/utils/utils.py @@ -45,7 +45,7 @@ def get_file_name(path: str): def compare_errors(compiler_path: str, cool_file_path: str, error_file_path: str, cmp=first_error, timeout=100): try: - sp = subprocess.run(['bash', compiler_path, cool_file_path], capture_output=True, timeout=timeout) + sp = subprocess.run(['bash', compiler_path, cool_file_path], stdout=subprocess.PIPE, timeout=timeout) return_code, output = sp.returncode, sp.stdout.decode() except subprocess.TimeoutExpired: assert False, COMPILER_TIMEOUT @@ -67,7 +67,7 @@ def compare_errors(compiler_path: str, cool_file_path: str, error_file_path: str (?:Loaded: .+\n)*''' def compare_outputs(compiler_path: str, cool_file_path: str, input_file_path: str, output_file_path: str, timeout=100): try: - sp = subprocess.run(['bash', compiler_path, cool_file_path], capture_output=True, timeout=timeout) + sp = subprocess.run(['bash', compiler_path, cool_file_path], timeout=timeout) assert sp.returncode == 0, TEST_MUST_COMPILE % get_file_name(cool_file_path) except subprocess.TimeoutExpired: assert False, COMPILER_TIMEOUT @@ -76,7 +76,7 @@ def compare_outputs(compiler_path: str, cool_file_path: str, input_file_path: st try: fd = open(input_file_path, 'rb') - sp = subprocess.run(['spim', '-file', spim_file], input=fd.read(), capture_output=True, timeout=timeout) + sp = subprocess.run(['spim', '-file', spim_file], input=fd.read(), timeout=timeout, capture_output=True) fd.close() mo = re.match(SPIM_HEADER, sp.stdout.decode()) if mo: