11# This module is part of GitPython and is released under
22# the BSD License: http://www.opensource.org/licenses/bsd-license.php
3- import sys
43import os
4+ import sys
5+ from unittest .case import skipIf
56
67import 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
139from git .exc import (
1410InvalidGitRepositoryError ,
1511RepositoryDirtyError
1612)
1713from git .objects .submodule .base import Submodule
1814from 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
2115from git .repo .fun import (
2216find_git_dir ,
2317touch
2418)
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+
2627
2728# Change the configuration if possible to prevent the underlying memory manager
2829# 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):
417418# Error if there is no submodule file here
418419self .failUnlessRaises (IOError ,Submodule ._config_parser ,rwrepo ,rwrepo .commit (self .k_no_subm_tag ),True )
419420
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"
421423"it is being used by another process: "
422424"'C:\\ Users\\ ankostis\\ AppData\\ Local\\ Temp\\ tmp95c3z83bnon_bare_test_base_rw\\ git\\ ext\\ gitdb\\ gitdb\\ ext\\ smmap'" )# noqa E501
423425@with_rw_repo (k_subm_current )
@@ -428,6 +430,11 @@ def test_base_rw(self, rwrepo):
428430def test_base_bare (self ,rwrepo ):
429431self ._do_base_tests (rwrepo )
430432
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\a ppveyor\AppData\Local\Temp\1 \t mplyp6kr_rnon_bare_test_root_module""" )# noqa E501
431438@with_rw_repo (k_subm_current ,bare = False )
432439def test_root_module (self ,rwrepo ):
433440# Can query everything without problems
@@ -726,6 +733,9 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir):
726733assert commit_sm .binsha == sm_too .binsha
727734assert sm_too .binsha != sm .binsha
728735
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
729739@with_rw_directory
730740def test_git_submodule_compatibility (self ,rwdir ):
731741parent = git .Repo .init (os .path .join (rwdir ,'parent' ))