Skip to content

Conversation

@tbhb
Copy link
Owner

@tbhb tbhb commented Jan 12, 2026

Summary

Fixes 29 Windows CI test failures by making test assertions platform-agnostic.

Three issues resolved:

  1. pyfakefs root directory conflict - fake_tree fixture defaulted to Path("/") which becomes C:\ on Windows pyfakefs, but C:\ already exists as a mount point causing FileExistsError. Changed default to Path("/fake_root").

  2. Path separator in __str__ assertion - test_str_shows_scope_path_pairs expected forward slashes (/project) but Windows uses backslashes (\project). Now uses f-strings with Path objects for platform-correct comparison.

  3. Exception message path format - PatternFileError tests hardcoded forward slashes in expected strings. Now constructs expected dynamically using the same Path object.

Test plan

  • All 362 local tests pass
  • All linters pass
  • Windows CI tests pass

Three issues causing 29 Windows CI failures:

1. pyfakefs root directory conflict: fake_tree fixture defaulted to Path("/")
   which becomes C:\ on Windows pyfakefs, but C:\ already exists as a mount
   point. Changed default to Path("/fake_root").

2. Path separator in __str__ assertion: test_str_shows_scope_path_pairs
   expected forward slashes but Windows uses backslashes. Now uses f-strings
   with Path objects for platform-correct comparison.

3. Exception message path format: PatternFileError tests hardcoded forward
   slashes in expected strings. Now constructs expected dynamically using
   the same Path object.
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

…ry errors

- Add Windows-specific test using monkeypatch for permission denied error
  since chmod doesn't restrict access on Windows
- Add Windows-specific test for directory error since pyfakefs raises
  PermissionError instead of IsADirectoryError on Windows
- Use skipif markers to run correct test variant per platform
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 12, 2026

Merging this PR will not alter performance

✅ 1 untouched benchmark


Comparing windows (e1e8d16) with main (eb42235)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (03db67d) during the generation of this report, so eb42235 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

complexipy (Rust-based) fails to compile on Windows with free-threaded
Python 3.14t due to missing python314.lib for Rust linking. Since linting
with complexipy runs on Ubuntu in the lint job, excluding it from Windows
test jobs has no coverage impact.
@tbhb tbhb merged commit eb46bb0 into main Jan 12, 2026
21 checks passed
@tbhb tbhb deleted the windows branch January 12, 2026 20:21
tbhb added a commit that referenced this pull request Jan 12, 2026
#3)

* test(windows): resolve test failures with platform-agnostic assertions

Three issues causing Windows CI failures:

1. pyfakefs root directory conflict: fake_tree fixture defaulted to Path("/")
   which becomes C:\ on Windows pyfakefs, but C:\ already exists as a mount
   point. Changed default to Path("/fake_root").

2. Path separator in __str__ assertion: test_str_shows_scope_path_pairs
   expected forward slashes but Windows uses backslashes. Now uses f-strings
   with Path objects for platform-correct comparison.

3. Exception message path format: PatternFileError tests hardcoded forward
   slashes in expected strings. Now constructs expected dynamically using
   the same Path object.

* test(windows): add platform-specific tests for permission and directory errors

- Add Windows-specific test using monkeypatch for permission denied error
  since chmod doesn't restrict access on Windows
- Add Windows-specific test for directory error since pyfakefs raises
  PermissionError instead of IsADirectoryError on Windows
- Use skipif markers to run correct test variant per platform

* build: exclude complexipy from Windows

complexipy fails to compile on Windows with free-threaded
Python 3.14t due to missing python314.lib for Rust linking.

* chore: use Python 3.13 for development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants