Skip to content

Commit 67082d6

Browse files
codexByron
authored andcommitted
test: skip relative config include across Windows drives
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
1 parent 7b0764d commit 67082d6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/test_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ def test_config_relative_path_include(self, rw_dir):
320320
with GitConfigParser(config_path, read_only=False) as cw:
321321
cw.set_value("include", "path", "included")
322322

323+
if osp.splitdrive(config_path)[0] != osp.splitdrive(os.getcwd())[0]:
324+
pytest.skip("The temporary directory and checkout are on different drives")
325+
323326
relative_config_path = osp.relpath(config_path)
324327
with GitConfigParser(relative_config_path, read_only=True) as cr:
325328
assert cr.get_value("included", "value") == "included"

0 commit comments

Comments
 (0)