From a469af892b3e929cbe9d29e414b6fcd59bec246e Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Mon, 3 Oct 2016 23:35:55 +0200 Subject: src: No PyDev warnings + Mark all unused vars and other non-pep8 (PyDev) warnings + test_utils: + enable & fix forgotten IterableList looped path. + unittestize all assertions. + remote: minor fix progress dispatching unknown err-lines --- git/test/test_refs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/test/test_refs.py') diff --git a/git/test/test_refs.py b/git/test/test_refs.py index 9816fb50..00b5232a 100644 --- a/git/test/test_refs.py +++ b/git/test/test_refs.py @@ -282,7 +282,7 @@ class TestRefs(TestBase): # tag ref tag_name = "5.0.2" - light_tag = TagReference.create(rw_repo, tag_name) + TagReference.create(rw_repo, tag_name) self.failUnlessRaises(GitCommandError, TagReference.create, rw_repo, tag_name) light_tag = TagReference.create(rw_repo, tag_name, "HEAD~1", force=True) assert isinstance(light_tag, TagReference) @@ -442,7 +442,7 @@ class TestRefs(TestBase): self.failUnlessRaises(OSError, SymbolicReference.create, rw_repo, symref_path, cur_head.reference.commit) # it works if the new ref points to the same reference - SymbolicReference.create(rw_repo, symref.path, symref.reference).path == symref.path + SymbolicReference.create(rw_repo, symref.path, symref.reference).path == symref.path # @NoEffect SymbolicReference.delete(rw_repo, symref) # would raise if the symref wouldn't have been deletedpbl symref = SymbolicReference.create(rw_repo, symref_path, cur_head.reference) -- cgit v1.2.1 From 8a2f7dce43617b773a6be425ea155812396d3856 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sun, 2 Oct 2016 14:26:15 +0200 Subject: io: Wrap (probably) allconfig_writers in `with` blocks --- git/test/test_refs.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'git/test/test_refs.py') diff --git a/git/test/test_refs.py b/git/test/test_refs.py index 00b5232a..43f1dcc7 100644 --- a/git/test/test_refs.py +++ b/git/test/test_refs.py @@ -101,15 +101,13 @@ class TestRefs(TestBase): assert prev_object == cur_object # represent the same git object assert prev_object is not cur_object # but are different instances - writer = head.config_writer() - tv = "testopt" - writer.set_value(tv, 1) - assert writer.get_value(tv) == 1 - writer.release() + with head.config_writer() as writer: + tv = "testopt" + writer.set_value(tv, 1) + assert writer.get_value(tv) == 1 assert head.config_reader().get_value(tv) == 1 - writer = head.config_writer() - writer.remove_option(tv) - writer.release() + with head.config_writer() as writer: + writer.remove_option(tv) # after the clone, we might still have a tracking branch setup head.set_tracking_branch(None) @@ -175,7 +173,7 @@ class TestRefs(TestBase): def test_orig_head(self): assert type(self.rorepo.head.orig_head()) == SymbolicReference - + @with_rw_repo('0.1.6') def test_head_checkout_detached_head(self, rw_repo): res = rw_repo.remotes.origin.refs.master.checkout() -- cgit v1.2.1