Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e359718

Browse filesBrowse files
committed
Revert "Add xfail marks for IndexFile.from_tree failures"
This removes the xfail marks from 8 tests that fail due to #1630, to be fixed in the subsequent commits. This reverts commit 6e477e3.
1 parent 96acc22 commit e359718
Copy full SHA for e359718

File tree

Expand file treeCollapse file tree

4 files changed

+5
-74
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+5
-74
lines changed

‎test/test_docs.py

Copy file name to clipboardExpand all lines: test/test_docs.py
+2-9Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
import pytest
1010

11-
from git.exc import GitCommandError
1211
from test.lib import TestBase
1312
from test.lib.helper import with_rw_directory
1413

14+
import os.path
15+
1516

1617
class Tutorials(TestBase):
1718
def tearDown(self):
@@ -206,14 +207,6 @@ def update(self, op_code, cur_count, max_count=None, message=""):
206207
assert sm.module_exists() # The submodule's working tree was checked out by update.
207208
# ![14-test_init_repo_object]
208209

209-
@pytest.mark.xfail(
210-
os.name == "nt",
211-
reason=(
212-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
213-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
214-
),
215-
raises=GitCommandError,
216-
)
217210
@with_rw_directory
218211
def test_references_and_objects(self, rw_dir):
219212
# [1-test_references_and_objects]

‎test/test_fun.py

Copy file name to clipboardExpand all lines: test/test_fun.py
+3-14Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33

44
from io import BytesIO
55
from stat import S_IFDIR, S_IFREG, S_IFLNK, S_IXUSR
6-
import os
6+
from os import stat
77
import os.path as osp
88

9-
import pytest
10-
119
from git import Git
12-
from git.exc import GitCommandError
1310
from git.index import IndexFile
1411
from git.index.fun import (
1512
aggressive_tree_merge,
@@ -37,14 +34,6 @@ def _assert_index_entries(self, entries, trees):
3734
assert (entry.path, entry.stage) in index.entries
3835
# END assert entry matches fully
3936

40-
@pytest.mark.xfail(
41-
os.name == "nt",
42-
reason=(
43-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
44-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
45-
),
46-
raises=GitCommandError,
47-
)
4837
def test_aggressive_tree_merge(self):
4938
# Head tree with additions, removals and modification compared to its predecessor.
5039
odb = self.rorepo.odb
@@ -302,12 +291,12 @@ def test_linked_worktree_traversal(self, rw_dir):
302291
rw_master.git.worktree("add", worktree_path, branch.name)
303292

304293
dotgit = osp.join(worktree_path, ".git")
305-
statbuf = os.stat(dotgit)
294+
statbuf = stat(dotgit)
306295
self.assertTrue(statbuf.st_mode & S_IFREG)
307296

308297
gitdir = find_worktree_git_dir(dotgit)
309298
self.assertIsNotNone(gitdir)
310-
statbuf = os.stat(gitdir)
299+
statbuf = stat(gitdir)
311300
self.assertTrue(statbuf.st_mode & S_IFDIR)
312301

313302
def test_tree_entries_from_data_with_failing_name_decode_py3(self):

‎test/test_index.py

Copy file name to clipboardExpand all lines: test/test_index.py
-40Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,6 @@ def add_bad_blob():
284284
except Exception as ex:
285285
assert "index.lock' could not be obtained" not in str(ex)
286286

287-
@pytest.mark.xfail(
288-
os.name == "nt",
289-
reason=(
290-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
291-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
292-
),
293-
raises=GitCommandError,
294-
)
295287
@with_rw_repo("0.1.6")
296288
def test_index_file_from_tree(self, rw_repo):
297289
common_ancestor_sha = "5117c9c8a4d3af19a9958677e45cda9269de1541"
@@ -342,14 +334,6 @@ def test_index_file_from_tree(self, rw_repo):
342334
# END for each blob
343335
self.assertEqual(num_blobs, len(three_way_index.entries))
344336

345-
@pytest.mark.xfail(
346-
os.name == "nt",
347-
reason=(
348-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
349-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
350-
),
351-
raises=GitCommandError,
352-
)
353337
@with_rw_repo("0.1.6")
354338
def test_index_merge_tree(self, rw_repo):
355339
# A bit out of place, but we need a different repo for this:
@@ -412,14 +396,6 @@ def test_index_merge_tree(self, rw_repo):
412396
self.assertEqual(len(unmerged_blobs), 1)
413397
self.assertEqual(list(unmerged_blobs.keys())[0], manifest_key[0])
414398

415-
@pytest.mark.xfail(
416-
os.name == "nt",
417-
reason=(
418-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
419-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
420-
),
421-
raises=GitCommandError,
422-
)
423399
@with_rw_repo("0.1.6")
424400
def test_index_file_diffing(self, rw_repo):
425401
# Default Index instance points to our index.
@@ -554,14 +530,6 @@ def _count_existing(self, repo, files):
554530

555531
# END num existing helper
556532

557-
@pytest.mark.xfail(
558-
os.name == "nt",
559-
reason=(
560-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
561-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
562-
),
563-
raises=GitCommandError,
564-
)
565533
@with_rw_repo("0.1.6")
566534
def test_index_mutation(self, rw_repo):
567535
index = rw_repo.index
@@ -915,14 +883,6 @@ def make_paths():
915883
for absfile in absfiles:
916884
assert osp.isfile(absfile)
917885

918-
@pytest.mark.xfail(
919-
os.name == "nt",
920-
reason=(
921-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
922-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
923-
),
924-
raises=GitCommandError,
925-
)
926886
@with_rw_repo("HEAD")
927887
def test_compare_write_tree(self, rw_repo):
928888
"""Test writing all trees, comparing them for equality."""

‎test/test_refs.py

Copy file name to clipboardExpand all lines: test/test_refs.py
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

66
from itertools import chain
7-
import os
87
from pathlib import Path
98

10-
import pytest
11-
129
from git import (
1310
Reference,
1411
Head,
@@ -218,14 +215,6 @@ def test_head_checkout_detached_head(self, rw_repo):
218215
assert isinstance(res, SymbolicReference)
219216
assert res.name == "HEAD"
220217

221-
@pytest.mark.xfail(
222-
os.name == "nt",
223-
reason=(
224-
"IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n"
225-
"'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'."
226-
),
227-
raises=GitCommandError,
228-
)
229218
@with_rw_repo("0.1.6")
230219
def test_head_reset(self, rw_repo):
231220
cur_head = rw_repo.head

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.