From 4abab92cb0f4caf569cc4bd9a8084994a80733ce Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 15 Nov 2023 14:54:53 -0500 Subject: [PATCH] Mark test_conditional_includes_from_git_dir xfail on Windows As noted, the second of the config._included_paths() assertions fails, which is in the "Ensure that config is included if path is matching git_dir" sub-case. It is returning 0 on Windows. THe GitConfigParser._has_includes function returns the expression: self._merge_includes and len(self._included_paths()) Since _merge_includes is a bool, it appears the first branch of the "and" is True, but then _included_paths returns an empty list. --- test/test_config.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/test_config.py b/test/test_config.py index 0e1bba08a..c1b26c91f 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -6,19 +6,15 @@ import glob import io import os +import os.path as osp from unittest import mock +import pytest + from git import GitConfigParser from git.config import _OMD, cp -from test.lib import ( - TestCase, - fixture_path, - SkipTest, -) -from test.lib import with_rw_directory - -import os.path as osp from git.util import rmfile +from test.lib import SkipTest, TestCase, fixture_path, with_rw_directory _tc_lock_fpaths = osp.join(osp.dirname(__file__), "fixtures/*.lock") @@ -239,6 +235,11 @@ def check_test_value(cr, value): with GitConfigParser(fpa, read_only=True) as cr: check_test_value(cr, tv) + @pytest.mark.xfail( + os.name == "nt", + reason='Second config._has_includes() assertion fails (for "config is included if path is matching git_dir")', + raises=AssertionError, + ) @with_rw_directory def test_conditional_includes_from_git_dir(self, rw_dir): # Initiate repository path.