Merge pull request #15096 from Opensource55/fix/tools-tests-utf8-decode

fix(tools): decode configure_seed and package_release test output as UTF-8
This commit is contained in:
Dean authored and GitHub committed 2026-11-03 18:14:02 +13:00
commit d68b36002d
2 files changed
+5 -4

No files matched your search

+3 -2
View File
@@ -185,7 +185,8 @@ class ConfigureSeedPathTests(unittest.TestCase):
self.skipTest(f"symbolic links unavailable: {error}")
for arguments in ((str(self.cache), str(loop)), (str(loop), str(self.root / "seed.cmake"))):
with self.subTest(arguments=arguments):
result = subprocess.run([sys.executable, str(TOOL), *arguments], capture_output=True, text=True)
result = subprocess.run([sys.executable, str(TOOL), *arguments],
capture_output=True, text=True, encoding="utf-8")
self.assertEqual(result.returncode, 2, result.stderr)
self.assertEqual(result.stdout, "")
self.assertIn(str(loop), result.stderr)
@@ -264,7 +265,7 @@ class ConfigureSeedTests(ConfigureSeedProject):
seed = self.root / "filtered.cmake"
result = subprocess.run([sys.executable, str(TOOL), str(self.root / "fresh" / "CMakeCache.txt"), str(seed),
"--include", "MINI_HAVE_*", "--include", "MINI_COMPILES", "--exclude", "*MISSING*"],
check=True, capture_output=True, text=True)
check=True, capture_output=True, text=True, encoding="utf-8")
self.assertIn("3 check results", result.stdout)
seeded = seed.read_text(encoding="utf-8")
self.assertIn("MINI_HAVE_STDIO_H", seeded)
+2 -2
View File
@@ -783,7 +783,7 @@ class ReleaseNoteDestinationsTests(unittest.TestCase):
previous = {path: path.read_bytes() for index, path in enumerate(paths) if index != position}
result = subprocess.run([sys.executable, str(Path(prepare_release_notes.__file__)),
"--input", str(paths[0]), "--body", str(paths[1]), "--full", str(paths[2])],
capture_output=True, text=True, timeout=30)
capture_output=True, text=True, encoding="utf-8", timeout=30)
self.assertEqual(result.returncode, 2, result.stderr)
self.assertNotIn("Traceback", result.stderr)
self.assertTrue(paths[position].is_symlink())
@@ -1156,7 +1156,7 @@ class ReleaseMainTests(unittest.TestCase):
self.skipTest(str(error))
result = subprocess.run([sys.executable, str(Path(package_release.__file__)),
"--docs", str(docs), "--output", str(output)],
capture_output=True, text=True, timeout=30)
capture_output=True, text=True, encoding="utf-8", timeout=30)
self.assertEqual(result.returncode, 2, result.stderr)
self.assertNotIn("Traceback", result.stderr)
self.assertIn("symbolic link loop", result.stderr)