fix(tests): support Windows path separators in kernel pull tests#1095
Merged
stevemessick merged 2 commits intoJul 9, 2026
Conversation
Contributor
|
/gcbrun |
stevemessick
requested changes
Jul 9, 2026
|
|
||
| # Verify file write | ||
| mock_open_file.assert_called_once_with("/tmp/dummy/my-slug.py", "w", encoding="utf-8") | ||
| expected_path = os.path.join("/tmp/dummy", "my-slug.py") |
Contributor
There was a problem hiding this comment.
As with #1091 (review), I find this confusing to read. If you're going to eliminate one slash then please remove them all. os.path.join("tmp", "dummy", "my-slug.py")
Also please note that we do not run tests on Windows during release testing.
Contributor
Author
There was a problem hiding this comment.
Very Sorry about that. I ended up making the same mistake again. I've updated the path construction to use os.path.join(...) consistently throughout the tests and verified that everything still passes.
Thanks for pointing it out again, I’ll be more careful about keeping this consistent in future PRs.
Contributor
|
/gcbrun |
stevemessick
approved these changes
Jul 9, 2026
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes platform-dependent assertions in the
kernels_pullunit tests.Problem
The tests in
tests/unit/test_kernels_pull.pyexpected hardcoded POSIX-style paths (for example,/tmp/dummy/my-slug.py). On Windows, the production code constructs paths usingos.path.join(), which produces Windows path separators. As a result, the tests failed even though the production code behaved correctly.Solution
Updated the test assertions to construct the expected paths using
os.path.join(), matching the behavior of the production code and making the tests platform-independent.No production code was changed.
Testing
Verified on Windows by running:
All four tests pass after the change.
Also ran:
All unit tests pass successfully.