From 0419c88ac298c72aa54240f17b9aab404586ffdc Mon Sep 17 00:00:00 2001 From: yusufipk Date: Sun, 16 Aug 2026 10:58:09 +0300 Subject: [PATCH] Run the tests on Windows too, which is where they have never run Sixty of them are about the Windows backends, and every one of them has only ever run on Linux and on a Mac: user32 and kernel32 are faked at the one function that loads them, which is the whole point and is also the whole limit. The half that reads the real system has been taken on trust. The Mac has had a job of its own for exactly this reason since it was ported, and the comment on it says what it is for; this is the same job with the same reason. What it should catch that nothing else does: whether %APPDATA% and %LOCALAPPDATA% are the directories Windows actually hands out, whether a path spelled with a backslash is still one the tests can read, whether the config-permission test skips rather than fails where the mode bits mean nothing, and whether install.ps1 parses. Running install.ps1 is not on the table: it writes into the Start Menu and the user PATH. --- .github/workflows/tests.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86eaa88..2366639 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,3 +74,41 @@ jobs: bash -n install-mac.sh bash -n update.sh bash -n uninstall.sh + + # The same job again for the same reason. The Windows backends are faked at + # the one function that loads user32 and kernel32, so every line of them is + # already read on the Linux above; what only this job can catch is the half + # that reads the real system. %APPDATA% and %LOCALAPPDATA% have to be the + # directories Windows actually hands out, a path spelled with a backslash has + # to be one the tests can still read, and the config-permission test has to + # skip rather than fail on a file system that decides by ACL. + windows: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + python: ["3.11", "3.13"] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + # No apt step: PyQt6's wheel carries the Qt DLLs it needs on Windows. + - name: Install PyQt6 + run: python -m pip install --quiet PyQt6 + + - name: Run the tests + run: python -m unittest discover --verbose + + # What the Mac does for its installer, in the language this one is in. + # Parsing only: install.ps1 writes into the Start Menu and the user PATH. + - name: Check the installer parses + shell: pwsh + run: | + $problems = $null + [System.Management.Automation.Language.Parser]::ParseFile( + "$PWD/install.ps1", [ref]$null, [ref]$problems) > $null + if ($problems) { $problems; exit 1 }