Make Python unittest suite pass on Windows #3
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by Batushn on 2026-11-23T20:06:00Z.
Summary
Make
python -m unittest discover -s testspass cleanly on Windows hosts (from 2 failures + 7 errors down to 0 failures / 0 errors), matching the existing@unittest.skipUnless(sys.platform == "linux", ...)convention already used intests/test_shader_prep.pyandtests/test_pipeline_prep.py:tests/test_runtime_shader_links.py: GateRuntimeShaderLinkswith@unittest.skipUnless(sys.platform == "linux", ...)?project_tuxbox.runtime_shadersuses Linux-onlyos.O_NONBLOCK,os.O_NOFOLLOW,ctypes.CDLL(None)(inotify_init1), andselect.poll(), and the tests useos.mkfifo,#!/bin/sh, and 199-char.linkrequest directory names that exceed WindowsMAX_PATH.tests/test_backend_log.py: Gate onlytest_proton_raw_log_arrives_live_and_drains_final_byteswith@unittest.skipUnless(sys.platform == "linux", ...)because it relies on POSIX unlink-while-open semantics (path.unlink()while_follow()holds an open handle on the priorsteam-default.log). The remaining 5 tests inBackendDiagnosticscontinue to run on Windows.tests/test_host.py:test_linux_title_drive_uses_prefix_and_preserves_existing_assignmentwith@unittest.skipUnless(sys.platform == "linux", ...)because it checks POSIX0o700mode bits and creates adosdevices/t:symlink (:is invalid in Windows filenames)."/tuxbox/build/frosty-cbv-layer") intest_direct_stock_launch_preserves_user_settings_and_host_environment, whereconsole_cbv_layeris already mocked and the surrounding env vars already use POSIX paths ("/user/layers","/user/mount"). Previouslyself.layercarried a Windows drive letter (C:\...), whose:collided withconsole_cbv.prepend()splittingVK_LAYER_PATHon:during the idempotence check. With this change, all 4 tests inConsoleConstantBufferscontinue to run and pass on both Linux and Windows.Verification
python -m unittest discover -s tests -von Windows (Python 3.12.10):Ran 87 tests ? FAILED (failures=2, errors=7, skipped=14)Ran 87 tests ? OK (skipped=22)(Disclosure: assisted by an AI coding agent; all changes were reviewed and verified locally.)