diff options
Diffstat (limited to 'git/test/test_remote.py')
-rw-r--r-- | git/test/test_remote.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 3fd71a1f..7b52ccce 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -267,7 +267,8 @@ class TestRemote(TestBase): # put origin to git-url other_origin = other_repo.remotes.origin - other_origin.config_writer.set("url", remote_repo_url) + with other_origin.config_writer as cw: + cw.set("url", remote_repo_url) # it automatically creates alternates as remote_repo is shared as well. # It will use the transport though and ignore alternates when fetching # assert not other_repo.alternates # this would fail @@ -416,13 +417,12 @@ class TestRemote(TestBase): self.failUnlessRaises(IOError, reader.set, opt, "test") # change value - writer = remote.config_writer - new_val = "myval" - writer.set(opt, new_val) - assert writer.get(opt) == new_val - writer.set(opt, val) - assert writer.get(opt) == val - del(writer) + with remote.config_writer as writer: + new_val = "myval" + writer.set(opt, new_val) + assert writer.get(opt) == new_val + writer.set(opt, val) + assert writer.get(opt) == val assert getattr(remote, opt) == val # END for each default option key |