Goal
Port the ~40 POSIX-shaped test fixtures so the Tests workflow can run on windows-latest again.
Why now
v0.7.3 added a Windows test job; v0.7.4 had to revert it because ~40 tests have hard-coded /Users/... literals, raw Path.resolve() that drive-prefixes on Windows, paths comparing \ vs /. The runtime code paths are correct (production code paths fixed in v0.7.3+) — only the tests are POSIX-shaped. The build matrix still validates Windows on every push (wheel + smoke test); this is the missing pytest coverage.
Schema
None. Pure test refactor.
User-visible surface
None (CI-only).
Implementation plan
- Audit:
grep -rn "/Users/" tests/ → list every hard-coded POSIX literal.
- Replace each with
tmp_path / "Users/..." or a cross-platform pathlib construction.
- Audit: every test that calls
Path.resolve() or Path.absolute() on a non-existent string path. On Windows these prepend the current drive — which is fine, but assertions about the resulting string break. Use os.path.samefile or normalised-comparison helpers.
- Audit: tests that compare paths with
assert "foo/bar" in result — replace with pathlib-based or separator-normalised comparison.
- Audit: tests that call
os.symlink, os.chmod(0o000), os.fork, signal.SIGTERM — already partially skipif'd (v0.7.3); finish the work.
- Re-enable
windows-latest in .github/workflows/test.yml matrix.
- Iterate based on the actual Windows CI failures (some won't surface until run on Windows).
Tests
None new — this is fixing existing tests.
Hard parts
- Some tests will need >1 round of CI feedback before fully green.
- A few may turn out to be genuinely Windows-incompatible (e.g., test exercising fcntl semantics) — those get
@pytest.mark.skipif(sys.platform == "win32") with rationale.
tests/conftest.py:set_home_env (v0.7.3) is the cross-platform helper for HOME — use it everywhere monkeypatch.setenv("HOME", ...) appears.
Out of scope
- Adding new tests.
- Adding more platforms (Linux already covered; macOS in build.yml; Windows is the gap).
Dependencies
Estimated effort
Size L — single agent, ~2-3 hr (audit + refactor + multiple Windows-CI iterations).
Hard rules
- DO NOT touch versions / CHANGELOG headings.
- DO NOT skip tests just to make them green — fix the root cause; only skip when the test is genuinely Windows-incompatible (and document why in the skipif reason).
- Branch:
feat/windows-test-port off main.
- Multiple commits OK as Windows CI iterates.
Goal
Port the ~40 POSIX-shaped test fixtures so the Tests workflow can run on
windows-latestagain.Why now
v0.7.3 added a Windows test job; v0.7.4 had to revert it because ~40 tests have hard-coded
/Users/...literals, rawPath.resolve()that drive-prefixes on Windows, paths comparing\vs/. The runtime code paths are correct (production code paths fixed in v0.7.3+) — only the tests are POSIX-shaped. The build matrix still validates Windows on every push (wheel + smoke test); this is the missing pytest coverage.Schema
None. Pure test refactor.
User-visible surface
None (CI-only).
Implementation plan
grep -rn "/Users/" tests/→ list every hard-coded POSIX literal.tmp_path / "Users/..."or a cross-platformpathlibconstruction.Path.resolve()orPath.absolute()on a non-existent string path. On Windows these prepend the current drive — which is fine, but assertions about the resulting string break. Useos.path.samefileor normalised-comparison helpers.assert "foo/bar" in result— replace withpathlib-based or separator-normalised comparison.os.symlink,os.chmod(0o000),os.fork,signal.SIGTERM— already partially skipif'd (v0.7.3); finish the work.windows-latestin.github/workflows/test.ymlmatrix.Tests
None new — this is fixing existing tests.
Hard parts
@pytest.mark.skipif(sys.platform == "win32")with rationale.tests/conftest.py:set_home_env(v0.7.3) is the cross-platform helper for HOME — use it everywheremonkeypatch.setenv("HOME", ...)appears.Out of scope
Dependencies
Estimated effort
Size L — single agent, ~2-3 hr (audit + refactor + multiple Windows-CI iterations).
Hard rules
feat/windows-test-portoff main.