diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 28802b358..999c452be 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -39,7 +39,7 @@ import logging import uuid from unittest.case import SkipTest -from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS +from git.util import HIDE_WINDOWS_KNOWN_ERRORS from git.objects.base import IndexObject, Object __all__ = ["Submodule", "UpdateProgress"] diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index e92ce8b40..092068b9f 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -31,11 +31,6 @@ log = logging.getLogger('git.util') -#: 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) - #{ Routines @@ -289,7 +284,7 @@ def remote_repo_creator(self): You can also run the daemon on a different port by passing --port=" and setting the environment variable GIT_PYTHON_TEST_GIT_DAEMON_PORT to """ % temp_dir) - from nose import SkipTest + from unittest import SkipTest raise SkipTest(msg) if is_win else AssertionError(msg) # END make assertion # END catch ls remote error diff --git a/git/test/performance/test_odb.py b/git/test/performance/test_odb.py index 6f07a6156..3879cb087 100644 --- a/git/test/performance/test_odb.py +++ b/git/test/performance/test_odb.py @@ -6,7 +6,7 @@ from unittest.case import skipIf from git.compat import PY3 -from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS +from git.util import HIDE_WINDOWS_KNOWN_ERRORS from .lib import ( TestBigRepoR diff --git a/git/test/test_base.py b/git/test/test_base.py index e5e8f173b..a4382d3ea 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -128,7 +128,7 @@ def test_add_unicode(self, rw_repo): try: file_path.encode(sys.getfilesystemencoding()) except UnicodeEncodeError: - from nose import SkipTest + from unittest import SkipTest raise SkipTest("Environment doesn't support unicode filenames") with open(file_path, "wb") as fp: diff --git a/git/test/test_index.py b/git/test/test_index.py index 340140649..d851743ef 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -43,7 +43,7 @@ fixture, with_rw_repo ) -from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS +from git.util import HIDE_WINDOWS_KNOWN_ERRORS from git.test.lib import with_rw_directory from git.util import Actor, rmtree from gitdb.base import IStream diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 1d537e931..b6359ad4f 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -50,11 +50,11 @@ assert_true, raises ) -from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS +from git.util import HIDE_WINDOWS_KNOWN_ERRORS from git.test.lib import with_rw_directory from git.util import join_path_native, rmtree, rmfile from gitdb.util import bin_to_hex -from nose import SkipTest +from unittest import SkipTest import functools as fnt import os.path as osp diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 46928f510..e935017fb 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -21,7 +21,7 @@ with_rw_repo ) from git.test.lib import with_rw_directory -from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS +from git.util import HIDE_WINDOWS_KNOWN_ERRORS from git.util import to_native_path_linux, join_path_native diff --git a/git/test/test_tree.py b/git/test/test_tree.py index bb62d9bfd..f36c43378 100644 --- a/git/test/test_tree.py +++ b/git/test/test_tree.py @@ -13,7 +13,7 @@ Tree, Blob ) -from git.test.lib.helper import HIDE_WINDOWS_KNOWN_ERRORS +from git.util import HIDE_WINDOWS_KNOWN_ERRORS from git.test.lib import TestBase diff --git a/git/util.py b/git/util.py index c96a6b087..57e056c3a 100644 --- a/git/util.py +++ b/git/util.py @@ -17,7 +17,7 @@ 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 @@ __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 onerror(func, path, exc_info): 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: