Skip to content

Commit 4abab92

Browse files
committed
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.
1 parent 42a3d74 commit 4abab92

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Diff for: test/test_config.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@
66
import glob
77
import io
88
import os
9+
import os.path as osp
910
from unittest import mock
1011

12+
import pytest
13+
1114
from git import GitConfigParser
1215
from git.config import _OMD, cp
13-
from test.lib import (
14-
TestCase,
15-
fixture_path,
16-
SkipTest,
17-
)
18-
from test.lib import with_rw_directory
19-
20-
import os.path as osp
2116
from git.util import rmfile
17+
from test.lib import SkipTest, TestCase, fixture_path, with_rw_directory
2218

2319

2420
_tc_lock_fpaths = osp.join(osp.dirname(__file__), "fixtures/*.lock")
@@ -239,6 +235,11 @@ def check_test_value(cr, value):
239235
with GitConfigParser(fpa, read_only=True) as cr:
240236
check_test_value(cr, tv)
241237

238+
@pytest.mark.xfail(
239+
os.name == "nt",
240+
reason='Second config._has_includes() assertion fails (for "config is included if path is matching git_dir")',
241+
raises=AssertionError,
242+
)
242243
@with_rw_directory
243244
def test_conditional_includes_from_git_dir(self, rw_dir):
244245
# Initiate repository path.

0 commit comments

Comments
 (0)