diff --git a/tests/test_compile_aarch64.py b/tests/test_compile_aarch64.py index 1f2dd33..552ab77 100644 --- a/tests/test_compile_aarch64.py +++ b/tests/test_compile_aarch64.py @@ -26,7 +26,7 @@ def run_command(command: list[str]) -> str: def check_for_qemu() -> bool: command = qemu_command + ['--version'] try: - result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8', check=False) + result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False) except Exception: return False return result.returncode == 0 diff --git a/tests/test_compile_armv7.py b/tests/test_compile_armv7.py index bf0fa89..5b1c6bb 100644 --- a/tests/test_compile_armv7.py +++ b/tests/test_compile_armv7.py @@ -26,7 +26,7 @@ def run_command(command: list[str]) -> str: def check_for_qemu() -> bool: command = qemu_command + ['--version'] try: - result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8', check=False) + result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False) except Exception: return False return result.returncode == 0 diff --git a/tests/test_ops_aarch64.py b/tests/test_ops_aarch64.py index 306454f..e912edf 100644 --- a/tests/test_ops_aarch64.py +++ b/tests/test_ops_aarch64.py @@ -41,7 +41,7 @@ def run_command(command: list[str]) -> str: def check_for_qemu() -> bool: command = qemu_command + ['--version'] try: - result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8', check=False) + result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False) except: return False return result.returncode == 0 diff --git a/tests/test_ops_armv7.py b/tests/test_ops_armv7.py index 0fd1b2b..1b53ca9 100644 --- a/tests/test_ops_armv7.py +++ b/tests/test_ops_armv7.py @@ -17,6 +17,7 @@ if os.name == 'nt': else: qemu_command = ['qemu-arm'] + def parse_results(log_text: str) -> dict[int, bytes]: regex = r"^READ_DATA offs=(\d*) size=(\d*) data=(.*)$" matches = re.finditer(regex, log_text, re.MULTILINE) @@ -31,6 +32,7 @@ def parse_results(log_text: str) -> dict[int, bytes]: return var_dict + def run_command(command: list[str]) -> str: result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8', check=False) assert result.returncode != 11, f"SIGSEGV (segmentation fault)\n -Error occurred: {result.stderr}\n -Output: {result.stdout}" @@ -41,7 +43,7 @@ def run_command(command: list[str]) -> str: def check_for_qemu() -> bool: command = qemu_command + ['--version'] try: - result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8', check=False) + result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False) except: return False return result.returncode == 0