From 6c923fb4199fcb59b777fac8de86395d9b30f042 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Mon, 30 Nov 2026 01:56:31 +0100 Subject: [PATCH 1/3] tests: the two write-failure cases need preexec_fn, which Windows does not have They fail on Windows today, and CI cannot see it because that file runs on Linux there: FeatureScanAtomicOutputTests' two "failed write" cases pass preexec_fn=fail_file_writes to subprocess, which is POSIX-only. Measured on main b8bd37111, Windows 11, Python 3.13: 2 failed, 14 passed before; 14 passed, 2 skipped after, with the reason printed. On POSIX nothing changes. Written with an AI assistant. --- tests/test_feature_scan.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_feature_scan.py b/tests/test_feature_scan.py index d79116f8dc..9792539fb1 100644 --- a/tests/test_feature_scan.py +++ b/tests/test_feature_scan.py @@ -590,6 +590,7 @@ def run_scan(self, shaders, report, *, fail_writes=False): preexec_fn=self.fail_file_writes if fail_writes else None, ) + @unittest.skipIf(os.name == "nt", "preexec_fn, which these two cases need, is POSIX-only") def test_failed_write_keeps_existing_report(self): with tempfile.TemporaryDirectory() as root: shaders = self.make_shaders(root) @@ -604,6 +605,7 @@ def test_failed_write_keeps_existing_report(self): with open(report, "rb") as stream: self.assertEqual(stream.read(), original) + @unittest.skipIf(os.name == "nt", "preexec_fn, which these two cases need, is POSIX-only") def test_failed_write_leaves_no_temporary_file(self): with tempfile.TemporaryDirectory() as root: shaders = self.make_shaders(root) From 0d947417717cdfb519d35d5cbb0686089a9ad390 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Mon, 30 Nov 2026 04:16:25 +0100 Subject: [PATCH 2/3] tests: the script run also executes FeatureScanAtomicOutputTests The `__main__` scan collects the `test_*` globals, so the class's three methods never ran in the plain-script invocation CI uses - which means the two skips this PR adds never took effect there either. The class is loaded explicitly now. Measured here: the script run goes from 13 top-level tests to those plus "Ran 3 tests ... OK (skipped=2)", and pytest still reports 14 passed, 2 skipped. Written with an AI assistant. --- tests/test_feature_scan.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_feature_scan.py b/tests/test_feature_scan.py index 9792539fb1..47c608fb94 100644 --- a/tests/test_feature_scan.py +++ b/tests/test_feature_scan.py @@ -635,7 +635,13 @@ def test_success_writes_valid_json(self): if __name__ == "__main__": # Every test_* function in the file, in file order, so a new test can't be left out of the script run. raised = run_tests([fn for name, fn in list(globals().items()) if name.startswith("test_") and callable(fn)]) - ok = not failures and not raised + # The class's cases are unittest methods, so the `test_*` scan above cannot see them: without this the script run + # (CI's standard-library job) skips them silently. + class_result = unittest.TextTestRunner(verbosity=0).run( + unittest.defaultTestLoader.loadTestsFromTestCase(FeatureScanAtomicOutputTests)) + class_failed = len(class_result.failures) + len(class_result.errors) + ok = not failures and not raised and not class_failed print(f"test_feature_scan: {'OK' if ok else 'FAILED'} ({failures} failed check{'s' if failures != 1 else ''}, " f"{len(raised)} failed test{'s' if len(raised) != 1 else ''})") sys.exit(0 if ok else 1) + From e5c84928064d06e22055da55bb7c1962d859132a Mon Sep 17 00:00:00 2001 From: fiestorra Date: Mon, 30 Nov 2026 15:47:16 +0100 Subject: [PATCH 3/3] tests: end the file with one newline, not two No content change. --- tests/test_feature_scan.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_feature_scan.py b/tests/test_feature_scan.py index 47c608fb94..e2b1473518 100644 --- a/tests/test_feature_scan.py +++ b/tests/test_feature_scan.py @@ -644,4 +644,3 @@ def test_success_writes_valid_json(self): print(f"test_feature_scan: {'OK' if ok else 'FAILED'} ({failures} failed check{'s' if failures != 1 else ''}, " f"{len(raised)} failed test{'s' if len(raised) != 1 else ''})") sys.exit(0 if ok else 1) -