GeezerVison is showing github.com — Revert "Add xfail marks for IndexFile.from_tree failures" · gitpython-developers/GitPython@e359718
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/test_docs.py +2-9Lines changed: 2 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 |
| 9 | 9 | import pytest | 10 | 10 |
| 11 | | -from git.exc import GitCommandError | 12 | 11 | from test.lib import TestBase | 13 | 12 | from test.lib.helper import with_rw_directory | 14 | 13 |
| | 14 | +import os.path | | 15 | + | 15 | 16 |
| 16 | 17 | class Tutorials(TestBase): | 17 | 18 | def tearDown(self): | @@ -206,14 +207,6 @@ def update(self, op_code, cur_count, max_count=None, message=""): | 206 | 207 | assert sm.module_exists() # The submodule's working tree was checked out by update. | 207 | 208 | # ![14-test_init_repo_object] | 208 | 209 |
| 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 | | - ) | 217 | 210 | @with_rw_directory | 218 | 211 | def test_references_and_objects(self, rw_dir): | 219 | 212 | # [1-test_references_and_objects] | |
Collapse file Copy file name to clipboardExpand all lines: test/test_fun.py +3-14Lines changed: 3 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 |
| 4 | 4 | from io import BytesIO | 5 | 5 | from stat import S_IFDIR, S_IFREG, S_IFLNK, S_IXUSR | 6 | | -import os | | 6 | +from os import stat | 7 | 7 | import os.path as osp | 8 | 8 |
| 9 | | -import pytest | 10 | | - | 11 | 9 | from git import Git | 12 | | -from git.exc import GitCommandError | 13 | 10 | from git.index import IndexFile | 14 | 11 | from git.index.fun import ( | 15 | 12 | aggressive_tree_merge, | @@ -37,14 +34,6 @@ def _assert_index_entries(self, entries, trees): | 37 | 34 | assert (entry.path, entry.stage) in index.entries | 38 | 35 | # END assert entry matches fully | 39 | 36 |
| 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 | | - ) | 48 | 37 | def test_aggressive_tree_merge(self): | 49 | 38 | # Head tree with additions, removals and modification compared to its predecessor. | 50 | 39 | odb = self.rorepo.odb | @@ -302,12 +291,12 @@ def test_linked_worktree_traversal(self, rw_dir): | 302 | 291 | rw_master.git.worktree("add", worktree_path, branch.name) | 303 | 292 |
| 304 | 293 | dotgit = osp.join(worktree_path, ".git") | 305 | | - statbuf = os.stat(dotgit) | | 294 | + statbuf = stat(dotgit) | 306 | 295 | self.assertTrue(statbuf.st_mode & S_IFREG) | 307 | 296 |
| 308 | 297 | gitdir = find_worktree_git_dir(dotgit) | 309 | 298 | self.assertIsNotNone(gitdir) | 310 | | - statbuf = os.stat(gitdir) | | 299 | + statbuf = stat(gitdir) | 311 | 300 | self.assertTrue(statbuf.st_mode & S_IFDIR) | 312 | 301 |
| 313 | 302 | def test_tree_entries_from_data_with_failing_name_decode_py3(self): | |
Collapse file Copy file name to clipboardExpand all lines: test/test_index.py -40Lines changed: 0 additions & 40 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -284,14 +284,6 @@ def add_bad_blob(): | 284 | 284 | except Exception as ex: | 285 | 285 | assert "index.lock' could not be obtained" not in str(ex) | 286 | 286 |
| 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 | | - ) | 295 | 287 | @with_rw_repo("0.1.6") | 296 | 288 | def test_index_file_from_tree(self, rw_repo): | 297 | 289 | common_ancestor_sha = "5117c9c8a4d3af19a9958677e45cda9269de1541" | @@ -342,14 +334,6 @@ def test_index_file_from_tree(self, rw_repo): | 342 | 334 | # END for each blob | 343 | 335 | self.assertEqual(num_blobs, len(three_way_index.entries)) | 344 | 336 |
| 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 | | - ) | 353 | 337 | @with_rw_repo("0.1.6") | 354 | 338 | def test_index_merge_tree(self, rw_repo): | 355 | 339 | # 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): | 412 | 396 | self.assertEqual(len(unmerged_blobs), 1) | 413 | 397 | self.assertEqual(list(unmerged_blobs.keys())[0], manifest_key[0]) | 414 | 398 |
| 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 | | - ) | 423 | 399 | @with_rw_repo("0.1.6") | 424 | 400 | def test_index_file_diffing(self, rw_repo): | 425 | 401 | # Default Index instance points to our index. | @@ -554,14 +530,6 @@ def _count_existing(self, repo, files): | 554 | 530 |
| 555 | 531 | # END num existing helper | 556 | 532 |
| 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 | | - ) | 565 | 533 | @with_rw_repo("0.1.6") | 566 | 534 | def test_index_mutation(self, rw_repo): | 567 | 535 | index = rw_repo.index | @@ -915,14 +883,6 @@ def make_paths(): | 915 | 883 | for absfile in absfiles: | 916 | 884 | assert osp.isfile(absfile) | 917 | 885 |
| 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 | | - ) | 926 | 886 | @with_rw_repo("HEAD") | 927 | 887 | def test_compare_write_tree(self, rw_repo): | 928 | 888 | """Test writing all trees, comparing them for equality.""" | |
Collapse file Copy file name to clipboardExpand all lines: test/test_refs.py -11Lines changed: 0 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ | 5 | 5 |
| 6 | 6 | from itertools import chain | 7 | | -import os | 8 | 7 | from pathlib import Path | 9 | 8 |
| 10 | | -import pytest | 11 | | - | 12 | 9 | from git import ( | 13 | 10 | Reference, | 14 | 11 | Head, | @@ -218,14 +215,6 @@ def test_head_checkout_detached_head(self, rw_repo): | 218 | 215 | assert isinstance(res, SymbolicReference) | 219 | 216 | assert res.name == "HEAD" | 220 | 217 |
| 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 | | - ) | 229 | 218 | @with_rw_repo("0.1.6") | 230 | 219 | def test_head_reset(self, rw_repo): | 231 | 220 | cur_head = rw_repo.head | |
|