From 51bf7cbe8216d9a1da723c59b6feece0b1a34589 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sun, 25 Sep 2016 18:08:16 +0200 Subject: win: GC.collect on all TC.tearDown to fix appveyor hang runs + Fixed the hangs at `test_git:TestGit.test_handle_process_output()`. [travisci skip] --- git/test/test_remote.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'git/test/test_remote.py') diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 3c2e622d..70c4a596 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -101,6 +101,10 @@ class TestRemoteProgress(RemoteProgress): class TestRemote(TestBase): + def tearDown(self): + import gc + gc.collect() + def _print_fetchhead(self, repo): fp = open(os.path.join(repo.git_dir, "FETCH_HEAD")) fp.close() -- cgit v1.2.1 From 6a3c95b408162c78b9a4230bb4f7274a94d0add4 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Mon, 26 Sep 2016 23:20:58 +0200 Subject: test, #519: No remote TCs, git-daemon cannot die@! --- git/test/test_remote.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'git/test/test_remote.py') diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 70c4a596..0060b5a6 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -26,7 +26,8 @@ from git import ( GitCommandError ) from git.util import IterableList -from git.compat import string_types +from git.compat import string_types, is_win +from unittest import skipIf import tempfile import shutil import os @@ -99,6 +100,7 @@ class TestRemoteProgress(RemoteProgress): assert self._num_progress_messages +@skipIf(is_win(), "git-daemon proc stuck on Appveyor!") class TestRemote(TestBase): def tearDown(self): @@ -407,7 +409,7 @@ class TestRemote(TestBase): # OPTIONS # cannot use 'fetch' key anymore as it is now a method - for opt in ("url", ): + for opt in ("url",): val = getattr(remote, opt) reader = remote.config_reader assert reader.get(opt) == val -- cgit v1.2.1 From c572a8d95d8fa184eb58b15b7ff96d01ef1f9ec3 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Tue, 27 Sep 2016 00:09:20 +0200 Subject: Win, #519: FIX undead Git-daemon on Windows + On MINGW-git, daemon exists but if invoked as 'git daemon', DAEMON CANNOT DIE! + So, launch `git-daemon` on Apveyor, but - remote TCs fail due to paths problems. + Updated README instructions on Windows. + Restore disabled remote TCs on Windows. + Disable failures on daemon-tests only the last moment (raise SkipTest) so when ready, it will also pass. --- git/test/test_remote.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'git/test/test_remote.py') diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 0060b5a6..2716d5b9 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -26,8 +26,7 @@ from git import ( GitCommandError ) from git.util import IterableList -from git.compat import string_types, is_win -from unittest import skipIf +from git.compat import string_types import tempfile import shutil import os @@ -100,7 +99,6 @@ class TestRemoteProgress(RemoteProgress): assert self._num_progress_messages -@skipIf(is_win(), "git-daemon proc stuck on Appveyor!") class TestRemote(TestBase): def tearDown(self): -- cgit v1.2.1 From 137ee6ef22c4e6480f95972ef220d1832cdc709a Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Tue, 27 Sep 2016 22:07:19 +0200 Subject: Win, #519: FIX with_rw_directory() to remove read-only dirs + Stop using gitdb's respective helper. + Fix files chmod(555) which CANNOT DELETE on Windows (but do on Linux). --- git/test/test_remote.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'git/test/test_remote.py') diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 2716d5b9..05de4ae2 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -25,10 +25,9 @@ from git import ( Remote, GitCommandError ) -from git.util import IterableList +from git.util import IterableList, rmtree from git.compat import string_types import tempfile -import shutil import os import random @@ -285,7 +284,7 @@ class TestRemote(TestBase): # and only provides progress information to ttys res = fetch_and_test(other_origin) finally: - shutil.rmtree(other_repo_dir) + rmtree(other_repo_dir) # END test and cleanup def _assert_push_and_pull(self, remote, rw_repo, remote_repo): -- cgit v1.2.1 From 9a521681ff8614beb8e2c566cf3c475baca22169 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sat, 1 Oct 2016 18:20:13 +0200 Subject: io, #519: ALL open() --> with open() + Some cases had restructuring of code. --- git/test/test_remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/test/test_remote.py') diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 05de4ae2..b99e49cf 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -105,8 +105,8 @@ class TestRemote(TestBase): gc.collect() def _print_fetchhead(self, repo): - fp = open(os.path.join(repo.git_dir, "FETCH_HEAD")) - fp.close() + with open(os.path.join(repo.git_dir, "FETCH_HEAD")): + pass def _do_test_fetch_result(self, results, remote): # self._print_fetchhead(remote.repo) -- cgit v1.2.1