diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-03 12:25:09 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-04 01:26:51 +0200 |
commit | be44602b633cfb49a472e192f235ba6de0055d38 (patch) | |
tree | f3bf2cf426e682aba1487174e7e38bd652b09a27 /git/test/lib/helper.py | |
parent | 86aa8738e0df54971e34f2e929484e0476c7f38a (diff) | |
download | gitpython-be44602b633cfb49a472e192f235ba6de0055d38.tar.gz |
hidden win-errs: Let leaking TCs run till end, then hide
+ Detect code breaking the body of TCs eventually hidden win-errors by
raising SkipTest ALAP.
+ submodule.base.py: import classes from `git.objects` instead of
`utils`.
+ had to ++ ulimit 100->110 for the extra code tested (more leaks :-)
+ Centralize is_win detection.
Diffstat (limited to 'git/test/lib/helper.py')
-rw-r--r-- | git/test/lib/helper.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index 36c706dc..3c9374e7 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -14,7 +14,6 @@ import logging from functools import wraps -from git import Repo, Remote, GitCommandError, Git from git.util import rmtree from git.compat import string_types, is_win import textwrap @@ -35,7 +34,7 @@ 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 = bool(os.environ.get('HIDE_WINDOWS_KNOWN_ERRORS', True)) +HIDE_WINDOWS_KNOWN_ERRORS = is_win and os.environ.get('HIDE_WINDOWS_KNOWN_ERRORS', True) #{ Routines @@ -172,6 +171,7 @@ def with_rw_repo(working_tree_ref, bare=False): def launch_git_daemon(temp_dir, ip, port): + from git import Git if is_win: ## On MINGW-git, daemon exists in .\Git\mingw64\libexec\git-core\, # but if invoked as 'git daemon', it detaches from parent `git` cmd, @@ -217,6 +217,7 @@ def with_rw_and_rw_remote_repo(working_tree_ref): See working dir info in with_rw_repo :note: We attempt to launch our own invocation of git-daemon, which will be shutdown at the end of the test. """ + from git import Remote, GitCommandError assert isinstance(working_tree_ref, string_types), "Decorator requires ref name for working tree checkout" def argument_passer(func): @@ -368,6 +369,7 @@ class TestBase(TestCase): Dynamically add a read-only repository to our actual type. This way each test type has its own repository """ + from git import Repo import gc gc.collect() cls.rorepo = Repo(GIT_REPO) |