summaryrefslogtreecommitdiff
path: root/git/test/test_remote.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2016-10-01 20:42:27 +0200
committerGitHub <noreply@github.com>2016-10-01 20:42:27 +0200
commit9d6b417ea3a4507ea78714f0cb7add75b13032d5 (patch)
tree77365cb808a255eb53889725bfce775b5090330e /git/test/test_remote.py
parent4592785004ad1a4869d650dc35a1e9099245dad9 (diff)
parent9a521681ff8614beb8e2c566cf3c475baca22169 (diff)
downloadgitpython-9d6b417ea3a4507ea78714f0cb7add75b13032d5.tar.gz
Merge pull request #519 from ankostis/appveyor
Test project on Windows with MINGW/Cygwin git (conda2.7&3.4/cpy-3.5)
Diffstat (limited to 'git/test/test_remote.py')
-rw-r--r--git/test/test_remote.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/git/test/test_remote.py b/git/test/test_remote.py
index 3c2e622d..b99e49cf 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
@@ -101,9 +100,13 @@ 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()
+ with open(os.path.join(repo.git_dir, "FETCH_HEAD")):
+ pass
def _do_test_fetch_result(self, results, remote):
# self._print_fetchhead(remote.repo)
@@ -281,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):
@@ -403,7 +406,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