| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,6 +32,11 @@ | |||
| 32 | 32 | ||
| 33 | 33 | log = logging.getLogger('git.util') | |
| 34 | 34 | ||
| 35 | + #: We need an easy way to see if Appveyor TCs start failing, | ||
| 36 | + #: so the errors marked with this var are considered "acknowledged" ones, awaiting remedy, | ||
| 37 | + #: till then, we wish to hide them. | ||
| 38 | + HIDE_WINDOWS_KNOWN_ERRORS = bool(os.environ.get('HIDE_WINDOWS_KNOWN_ERRORS', False)) | ||
| 39 | + | ||
| 35 | 40 | #{ Routines | |
| 36 | 41 | ||
| 37 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | #{ Invvariants | |
| 21 | 21 | k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE" | |
| 22 | + | ||
| 22 | 23 | #} END invariants | |
| 23 | 24 | ||
| 24 | 25 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,7 @@ | |||
| 6 | 6 | from unittest.case import skipIf | |
| 7 | 7 | ||
| 8 | 8 | from git.compat import is_win, PY3 | |
| 9 | + from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS | ||
| 9 | 10 | ||
| 10 | 11 | from .lib import ( | |
| 11 | 12 | TestBigRepoR | |
@@ -14,7 +15,8 @@ | |||
| 14 | 15 | ||
| 15 | 16 | class TestObjDBPerformance(TestBigRepoR): | |
| 16 | 17 | ||
| 17 | - @skipIf(is_win and PY3, "FIXME: smmp fails with: TypeError: Can't convert 'bytes' object to str implicitly") | ||
| 18 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win and PY3, | ||
| 19 | + "FIXME: smmp fails with: TypeError: Can't convert 'bytes' object to str implicitly") | ||
| 18 | 20 | def test_random_access(self): | |
| 19 | 21 | results = [["Iterate Commits"], ["Iterate Blobs"], ["Retrieve Blob Data"]] | |
| 20 | 22 | for repo in (self.gitrorepo, self.puregitrorepo): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,11 @@ | |||
| 5 | 5 | # This module is part of GitPython and is released under | |
| 6 | 6 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 7 | 7 | import os | |
| 8 | + import sys | ||
| 9 | + from unittest.case import skipIf | ||
| 8 | 10 | ||
| 11 | + from git.compat import is_win | ||
| 12 | + from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS | ||
| 9 | 13 | from git.test.lib import TestBase | |
| 10 | 14 | from git.test.lib.helper import with_rw_directory | |
| 11 | 15 | ||
@@ -16,6 +20,9 @@ def tearDown(self): | |||
| 16 | 20 | import gc | |
| 17 | 21 | gc.collect() | |
| 18 | 22 | ||
| 23 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win and sys.version_info[:2] in ((2, 7), (3, 4)), | ||
| 24 | + "FIXME: helper.wrapper fails with: PermissionError: [WinError 5] Access is denied: " | ||
| 25 | + "'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\test_work_tree_unsupportedryfa60di\\master_repo\\.git\\objects\\pack\\pack-bc9e0787aef9f69e1591ef38ea0a6f566ec66fe3.idx") # noqa E501 | ||
| 19 | 26 | @with_rw_directory | |
| 20 | 27 | def test_init_repo_object(self, rw_dir): | |
| 21 | 28 | # [1-test_init_repo_object] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,17 +5,16 @@ | |||
| 5 | 5 | # This module is part of GitPython and is released under | |
| 6 | 6 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 7 | 7 | ||
| 8 | - from git.test.lib import ( | ||
| 9 | - TestBase, | ||
| 10 | - fixture_path, | ||
| 11 | - fixture, | ||
| 12 | - with_rw_repo | ||
| 13 | - ) | ||
| 14 | - from git.util import Actor, rmtree | ||
| 15 | - from git.exc import ( | ||
| 16 | - HookExecutionError, | ||
| 17 | - InvalidGitRepositoryError | ||
| 8 | + from io import BytesIO | ||
| 9 | + import os | ||
| 10 | + from stat import ( | ||
| 11 | + S_ISLNK, | ||
| 12 | + ST_MODE | ||
| 18 | 13 | ) | |
| 14 | + import sys | ||
| 15 | + import tempfile | ||
| 16 | + from unittest.case import skipIf | ||
| 17 | + | ||
| 19 | 18 | from git import ( | |
| 20 | 19 | IndexFile, | |
| 21 | 20 | Repo, | |
@@ -28,24 +27,27 @@ | |||
| 28 | 27 | CheckoutError, | |
| 29 | 28 | ) | |
| 30 | 29 | from git.compat import string_types, is_win | |
| 31 | - from gitdb.util import hex_to_bin | ||
| 32 | - import os | ||
| 33 | - import sys | ||
| 34 | - import tempfile | ||
| 35 | - from stat import ( | ||
| 36 | - S_ISLNK, | ||
| 37 | - ST_MODE | ||
| 30 | + from git.exc import ( | ||
| 31 | + HookExecutionError, | ||
| 32 | + InvalidGitRepositoryError | ||
| 38 | 33 | ) | |
| 39 | - | ||
| 40 | - from io import BytesIO | ||
| 41 | - from gitdb.base import IStream | ||
| 42 | - from git.objects import Blob | ||
| 34 | + from git.index.fun import hook_path | ||
| 43 | 35 | from git.index.typ import ( | |
| 44 | 36 | BaseIndexEntry, | |
| 45 | 37 | IndexEntry | |
| 46 | 38 | ) | |
| 47 | - from git.index.fun import hook_path | ||
| 39 | + from git.objects import Blob | ||
| 40 | + from git.test.lib import ( | ||
| 41 | + TestBase, | ||
| 42 | + fixture_path, | ||
| 43 | + fixture, | ||
| 44 | + with_rw_repo | ||
| 45 | + ) | ||
| 46 | + from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS | ||
| 48 | 47 | from git.test.lib import with_rw_directory | |
| 48 | + from git.util import Actor, rmtree | ||
| 49 | + from gitdb.base import IStream | ||
| 50 | + from gitdb.util import hex_to_bin | ||
| 49 | 51 | ||
| 50 | 52 | ||
| 51 | 53 | class TestIndex(TestBase): | |
@@ -821,6 +823,10 @@ def test_index_bare_add(self, rw_bare_repo): | |||
| 821 | 823 | asserted = True | |
| 822 | 824 | assert asserted, "Adding using a filename is not correctly asserted." | |
| 823 | 825 | ||
| 826 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win and sys.version_info[:2] == (2, 7), r""" | ||
| 827 | + FIXME: File "C:\projects\gitpython\git\util.py", line 125, in to_native_path_linux | ||
| 828 | + return path.replace('\\', '/') | ||
| 829 | + UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)""") | ||
| 824 | 830 | @with_rw_directory | |
| 825 | 831 | def test_add_utf8P_path(self, rw_dir): | |
| 826 | 832 | # NOTE: fp is not a Unicode object in python 2 (which is the source of the problem) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,11 +7,11 @@ | |||
| 7 | 7 | import glob | |
| 8 | 8 | from io import BytesIO | |
| 9 | 9 | import itertools | |
| 10 | - import functools as fnt | ||
| 11 | 10 | import os | |
| 12 | 11 | import pickle | |
| 13 | 12 | import sys | |
| 14 | 13 | import tempfile | |
| 14 | + from unittest.case import skipIf | ||
| 15 | 15 | ||
| 16 | 16 | from git import ( | |
| 17 | 17 | InvalidGitRepositoryError, | |
@@ -50,13 +50,14 @@ | |||
| 50 | 50 | assert_true, | |
| 51 | 51 | raises | |
| 52 | 52 | ) | |
| 53 | + from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS | ||
| 53 | 54 | from git.test.lib import with_rw_directory | |
| 54 | 55 | from git.util import join_path_native, rmtree, rmfile | |
| 55 | 56 | from gitdb.util import bin_to_hex | |
| 56 | 57 | from nose import SkipTest | |
| 57 | 58 | ||
| 59 | + import functools as fnt | ||
| 58 | 60 | import os.path as osp | |
| 59 | - from unittest.case import skipIf | ||
| 60 | 61 | ||
| 61 | 62 | ||
| 62 | 63 | def iter_flatten(lol): | |
@@ -796,7 +797,8 @@ def test_git_file(self, rwrepo): | |||
| 796 | 797 | git_file_repo = Repo(rwrepo.working_tree_dir) | |
| 797 | 798 | self.assertEqual(os.path.abspath(git_file_repo.git_dir), real_path_abs) | |
| 798 | 799 | ||
| 799 | - @skipIf(is_win and PY3, "FIXME: smmp fails with: TypeError: Can't convert 'bytes' object to str implicitly") | ||
| 800 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win and PY3, | ||
| 801 | + "FIXME: smmp fails with: TypeError: Can't convert 'bytes' object to str implicitly") | ||
| 800 | 802 | def test_file_handle_leaks(self): | |
| 801 | 803 | def last_commit(repo, rev, path): | |
| 802 | 804 | commit = next(repo.iter_commits(rev, path, max_count=1)) | |
@@ -895,6 +897,9 @@ def test_is_ancestor(self): | |||
| 895 | 897 | for i, j in itertools.permutations([c1, 'ffffff', ''], r=2): | |
| 896 | 898 | self.assertRaises(GitCommandError, repo.is_ancestor, i, j) | |
| 897 | 899 | ||
| 900 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win, | ||
| 901 | + "FIXME: helper.wrapper fails with: PermissionError: [WinError 5] Access is denied: " | ||
| 902 | + "'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\test_work_tree_unsupportedryfa60di\\master_repo\\.git\\objects\\pack\\pack-bc9e0787aef9f69e1591ef38ea0a6f566ec66fe3.idx") # noqa E501 | ||
| 898 | 903 | @with_rw_directory | |
| 899 | 904 | def test_work_tree_unsupported(self, rw_dir): | |
| 900 | 905 | git = Git(rw_dir) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,28 +1,29 @@ | |||
| 1 | 1 | # This module is part of GitPython and is released under | |
| 2 | 2 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 3 | - import sys | ||
| 4 | 3 | import os | |
| 4 | + import sys | ||
| 5 | + from unittest.case import skipIf | ||
| 5 | 6 | ||
| 6 | 7 | import git | |
| 7 | - | ||
| 8 | - from git.test.lib import ( | ||
| 9 | - TestBase, | ||
| 10 | - with_rw_repo | ||
| 11 | - ) | ||
| 12 | - from git.test.lib import with_rw_directory | ||
| 8 | + from git.compat import string_types, is_win | ||
| 13 | 9 | from git.exc import ( | |
| 14 | 10 | InvalidGitRepositoryError, | |
| 15 | 11 | RepositoryDirtyError | |
| 16 | 12 | ) | |
| 17 | 13 | from git.objects.submodule.base import Submodule | |
| 18 | 14 | from git.objects.submodule.root import RootModule, RootUpdateProgress | |
| 19 | - from git.util import to_native_path_linux, join_path_native | ||
| 20 | - from git.compat import string_types, is_win | ||
| 21 | 15 | from git.repo.fun import ( | |
| 22 | 16 | find_git_dir, | |
| 23 | 17 | touch | |
| 24 | 18 | ) | |
| 25 | - from unittest.case import skipIf | ||
| 19 | + from git.test.lib import ( | ||
| 20 | + TestBase, | ||
| 21 | + with_rw_repo | ||
| 22 | + ) | ||
| 23 | + from git.test.lib import with_rw_directory | ||
| 24 | + from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS | ||
| 25 | + from git.util import to_native_path_linux, join_path_native | ||
| 26 | + | ||
| 26 | 27 | ||
| 27 | 28 | # Change the configuration if possible to prevent the underlying memory manager | |
| 28 | 29 | # to keep file handles open. On windows we get problems as they are not properly | |
@@ -417,7 +418,8 @@ def _do_base_tests(self, rwrepo): | |||
| 417 | 418 | # Error if there is no submodule file here | |
| 418 | 419 | self.failUnlessRaises(IOError, Submodule._config_parser, rwrepo, rwrepo.commit(self.k_no_subm_tag), True) | |
| 419 | 420 | ||
| 420 | - @skipIf(is_win, "FIXME: fails with: PermissionError: [WinError 32] The process cannot access the file because" | ||
| 421 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win, | ||
| 422 | + "FIXME: fails with: PermissionError: [WinError 32] The process cannot access the file because" | ||
| 421 | 423 | "it is being used by another process: " | |
| 422 | 424 | "'C:\\Users\\ankostis\\AppData\\Local\\Temp\\tmp95c3z83bnon_bare_test_base_rw\\git\\ext\\gitdb\\gitdb\\ext\\smmap'") # noqa E501 | |
| 423 | 425 | @with_rw_repo(k_subm_current) | |
@@ -428,6 +430,11 @@ def test_base_rw(self, rwrepo): | |||
| 428 | 430 | def test_base_bare(self, rwrepo): | |
| 429 | 431 | self._do_base_tests(rwrepo) | |
| 430 | 432 | ||
| 433 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win and sys.version_info[:2] == (3, 4), """ | ||
| 434 | + File "C:\projects\gitpython\git\cmd.py", line 559, in execute | ||
| 435 | + raise GitCommandNotFound(command, err) | ||
| 436 | + git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') | ||
| 437 | + cmdline: git clone -n --shared -v C:\projects\gitpython\.git Users\appveyor\AppData\Local\Temp\1\tmplyp6kr_rnon_bare_test_root_module""") # noqa E501 | ||
| 431 | 438 | @with_rw_repo(k_subm_current, bare=False) | |
| 432 | 439 | def test_root_module(self, rwrepo): | |
| 433 | 440 | # Can query everything without problems | |
@@ -726,6 +733,9 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir): | |||
| 726 | 733 | assert commit_sm.binsha == sm_too.binsha | |
| 727 | 734 | assert sm_too.binsha != sm.binsha | |
| 728 | 735 | ||
| 736 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win, | ||
| 737 | + "FIXME: helper.wrapper fails with: PermissionError: [WinError 5] Access is denied: " | ||
| 738 | + "'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\test_work_tree_unsupportedryfa60di\\master_repo\\.git\\objects\\pack\\pack-bc9e0787aef9f69e1591ef38ea0a6f566ec66fe3.idx") # noqa E501 | ||
| 729 | 739 | @with_rw_directory | |
| 730 | 740 | def test_git_submodule_compatibility(self, rwdir): | |
| 731 | 741 | parent = git.Repo.init(os.path.join(rwdir, 'parent')) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,18 +4,27 @@ | |||
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | ||
| 7 | + from io import BytesIO | ||
| 7 | 8 | import os | |
| 8 | - from git.test.lib import TestBase | ||
| 9 | + import sys | ||
| 10 | + from unittest.case import skipIf | ||
| 11 | + | ||
| 9 | 12 | from git import ( | |
| 10 | 13 | Tree, | |
| 11 | 14 | Blob | |
| 12 | 15 | ) | |
| 13 | - | ||
| 14 | - from io import BytesIO | ||
| 16 | + from git.compat import is_win | ||
| 17 | + from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS | ||
| 18 | + from git.test.lib import TestBase | ||
| 15 | 19 | ||
| 16 | 20 | ||
| 17 | 21 | class TestTree(TestBase): | |
| 18 | 22 | ||
| 23 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win and sys.version_info[:2] == (3, 4), """ | ||
| 24 | + File "C:\projects\gitpython\git\cmd.py", line 559, in execute | ||
| 25 | + raise GitCommandNotFound(command, err) | ||
| 26 | + git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') | ||
| 27 | + cmdline: git cat-file --batch-check""") | ||
| 19 | 28 | def test_serializable(self): | |
| 20 | 29 | # tree at the given commit contains a submodule as well | |
| 21 | 30 | roottree = self.rorepo.tree('6c1faef799095f3990e9970bc2cb10aa0221cf9c') | |
@@ -44,6 +53,11 @@ def test_serializable(self): | |||
| 44 | 53 | testtree._deserialize(stream) | |
| 45 | 54 | # END for each item in tree | |
| 46 | 55 | ||
| 56 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and is_win and sys.version_info[:2] == (3, 4), """ | ||
| 57 | + File "C:\projects\gitpython\git\cmd.py", line 559, in execute | ||
| 58 | + raise GitCommandNotFound(command, err) | ||
| 59 | + git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') | ||
| 60 | + cmdline: git cat-file --batch-check""") | ||
| 47 | 61 | def test_traverse(self): | |
| 48 | 62 | root = self.rorepo.tree('0.1.6') | |
| 49 | 63 | num_recursive = 0 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments