diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-11 13:06:02 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-11 13:06:02 +0200 |
commit | 74c7ed0e809d6f3d691d8251c70f9a5dab5fb18d (patch) | |
tree | 70d43d2a2f75eaceba3e17d879a6ec9bdc84dbe6 /git/util.py | |
parent | 4e5ef73d3d6d9b973a756fddd329cfa2a24884e2 (diff) | |
download | gitpython-74c7ed0e809d6f3d691d8251c70f9a5dab5fb18d.tar.gz |
FIX #526: Do not depend on test-sources
+ Move `HIDE_WINDOWS_KNOWN_ERRORS` flag from
`git.test.lib.helper-->git.util`;
regular modules in main-sources folder also depend on that flag.
+ Use unittest.SkipTest instead of from non-standard `nose` lib.
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/git/util.py b/git/util.py index c96a6b08..57e056c3 100644 --- a/git/util.py +++ b/git/util.py @@ -17,7 +17,7 @@ import time from functools import wraps from git.compat import is_win -from gitdb.util import ( # NOQA +from gitdb.util import (# NOQA make_sha, LockedFD, # @UnusedImport file_contents_ro, # @UnusedImport @@ -44,7 +44,13 @@ from unittest.case import SkipTest __all__ = ("stream_copy", "join_path", "to_native_path_windows", "to_native_path_linux", "join_path_native", "Stats", "IndexFileSHA1Writer", "Iterable", "IterableList", "BlockingLockFile", "LockFile", 'Actor', 'get_user_id', 'assure_directory_exists', - 'RemoteProgress', 'CallableRemoteProgress', 'rmtree', 'unbare_repo') + 'RemoteProgress', 'CallableRemoteProgress', 'rmtree', 'unbare_repo', + 'HIDE_WINDOWS_KNOWN_ERRORS') + +#: We need an easy way to see if Appveyor TCs start failing, +#: so the errors marked with this var are considered "acknowledged" ones, awaiting remedy, +#: till then, we wish to hide them. +HIDE_WINDOWS_KNOWN_ERRORS = is_win and os.environ.get('HIDE_WINDOWS_KNOWN_ERRORS', True) #{ Utility Methods @@ -76,7 +82,6 @@ def rmtree(path): try: func(path) # Will scream if still not possible to delete. except Exception as ex: - from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS if HIDE_WINDOWS_KNOWN_ERRORS: raise SkipTest("FIXME: fails with: PermissionError\n %s", ex) else: |