Skip cross-drive relative config test on Windows#2171
Merged
Conversation
On Windows, the writable temporary directory and the checkout can be on different drives. os.path.relpath() raises ValueError for such paths before GitConfigParser is exercised. Skip this relative-path-specific test on Windows, where the test setup cannot reliably construct the required relative path. Validation: - pytest -q test/test_config.py - ruff check test/test_config.py - ruff format --check test/test_config.py
Member
Author
|
Merging early as it should fix the windows test, and there don't seem to be many runners these days. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a Windows-specific failure in test_config_relative_path_include caused by os.path.relpath() raising ValueError when the temporary directory and the current working directory are on different drives. It adds a conditional skip so the test is only skipped in the cross-drive scenario, preserving coverage when both are on the same drive.
Changes:
- Add a runtime check comparing the drive of
config_pathvs the current working directory. - Skip the test when those drives differ to avoid
relpath()cross-drive failures on Windows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+323
to
+324
| if osp.splitdrive(config_path)[0] != osp.splitdrive(os.getcwd())[0]: | ||
| pytest.skip("The temporary directory and checkout are on different drives") |
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.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by
Codex GPT-5.Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Reported issue