From fab7d4eb2fb3f48afce566cec96d3977bf3d3548 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 9 Oct 2026 22:57:15 +0200 Subject: [PATCH] chore: read the exit code of the region runs --- tests/test_region.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_region.py b/tests/test_region.py index 87f33786..528d60ce 100644 --- a/tests/test_region.py +++ b/tests/test_region.py @@ -436,26 +436,32 @@ class TestVerifyModesHonourRegion(unittest.TestCase): """ def _run(self, *args: str) -> str: + """The report, from a run that succeeded. + + A run that crashed produced an empty stdout, different from the + plain report, and the test read the difference as narrowing. + """ import subprocess repo = os.path.join(os.path.dirname(__file__), "..") - return subprocess.run( + completed = subprocess.run( [sys.executable, "scripts/verify.py", *args], - capture_output=True, text=True, cwd=repo, timeout=900, - ).stdout + capture_output=True, text=True, cwd=repo, timeout=900, check=False, + ) + self.assertEqual(completed.returncode, 0, completed.stderr[-2000:]) + self.assertTrue(completed.stdout.strip(), "an empty report is not a report") + return completed.stdout def test_emulator_mode_narrows(self): plain = self._run("--emulator", "duckstation") - filtered = self._run("--emulator", "duckstation", "--region", "us") if "duckstation" not in plain: self.skipTest("duckstation profile not present") + filtered = self._run("--emulator", "duckstation", "--region", "us") self.assertNotEqual(plain, filtered) def test_system_mode_narrows(self): plain = self._run("--system", "sony-playstation") filtered = self._run("--system", "sony-playstation", "--region", "us") - if not plain.strip(): - self.skipTest("system not present") self.assertNotEqual(plain, filtered)