Skip to content

Commit

Permalink
Mark test_conditional_includes_from_git_dir xfail on Windows
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EliahKagan committed Nov 24, 2023
1 parent 42a3d74 commit 4abab92
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 4abab92

Please sign in to comment.