aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_suite.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-03-24 17:38:41 -0400
committerDavid Robillard <d@drobilla.net>2025-03-24 17:40:50 -0400
commit64dba9134520547180d2e9404f5a7b592e560ae5 (patch)
tree5b458af0091423caff52b1ddbe1c0f44635d7eb8 /test/run_suite.py
parent8785ef4b74e6a54cdd7c83e69c01a72d8e200314 (diff)
downloadserd-64dba9134520547180d2e9404f5a7b592e560ae5.tar.gz
serd-64dba9134520547180d2e9404f5a7b592e560ae5.tar.bz2
serd-64dba9134520547180d2e9404f5a7b592e560ae5.zip
Always specify encoding to subprocess run functions
Diffstat (limited to 'test/run_suite.py')
-rwxr-xr-xtest/run_suite.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/run_suite.py b/test/run_suite.py
index 3811a74e..84c74dd1 100755
--- a/test/run_suite.py
+++ b/test/run_suite.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-# Copyright 2022-2023 David Robillard <d@drobilla.net>
+# Copyright 2022-2025 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: ISC
"""Run a "simple" one-pass RDF-based test suite for serd."""
@@ -43,7 +43,7 @@ def run_eval_test(base_uri, command, in_path, good_path, out_path):
syntax = util.syntax_from_path(out_path)
command = command + ["-o", syntax, in_path, base_uri]
- with subprocess.Popen(command, stdout=PIPE, encoding="utf-8") as proc:
+ with subprocess.Popen(command, encoding="utf-8", stdout=PIPE) as proc:
out = list(proc.stdout)
with open(good_path, "r", encoding="utf-8") as good:
@@ -65,7 +65,9 @@ def run_negative_test(base_uri, command, in_path, ignore):
raise RuntimeError("Input file missing: " + in_path)
command = command + [in_path, base_uri]
- proc = subprocess.run(command, check=False, stderr=PIPE, stdout=DEVNULL)
+ proc = subprocess.run(
+ command, check=False, encoding="utf-8", stderr=PIPE, stdout=DEVNULL
+ )
if not ignore and proc.returncode == 0:
util.error("Unexpected successful return: " + in_path)