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 | |
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')
-rw-r--r-- | git/objects/submodule/base.py | 2 | ||||
-rw-r--r-- | git/test/lib/helper.py | 7 | ||||
-rw-r--r-- | git/test/performance/test_odb.py | 2 | ||||
-rw-r--r-- | git/test/test_base.py | 2 | ||||
-rw-r--r-- | git/test/test_index.py | 2 | ||||
-rw-r--r-- | git/test/test_repo.py | 4 | ||||
-rw-r--r-- | git/test/test_submodule.py | 2 | ||||
-rw-r--r-- | git/test/test_tree.py | 2 | ||||
-rw-r--r-- | git/util.py | 11 |
9 files changed, 17 insertions, 17 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 28802b35..999c452b 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -39,7 +39,7 @@ import os 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 e92ce8b4..092068b9 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -31,11 +31,6 @@ __all__ = ( 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 with_rw_and_rw_remote_repo(working_tree_ref): You can also run the daemon on a different port by passing --port=<port>" and setting the environment variable GIT_PYTHON_TEST_GIT_DAEMON_PORT to <port> """ % 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 6f07a615..3879cb08 100644 --- a/git/test/performance/test_odb.py +++ b/git/test/performance/test_odb.py @@ -6,7 +6,7 @@ from time import time 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 e5e8f173..a4382d3e 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -128,7 +128,7 @@ class TestBase(TestBase): 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 34014064..d851743e 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -43,7 +43,7 @@ from git.test.lib import ( 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 1d537e93..b6359ad4 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -50,11 +50,11 @@ from git.test.lib import ( 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 46928f51..e935017f 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -21,7 +21,7 @@ from git.test.lib import ( 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 bb62d9bf..f36c4337 100644 --- a/git/test/test_tree.py +++ b/git/test/test_tree.py @@ -13,7 +13,7 @@ from git import ( 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 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: |