diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-01 18:20:13 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-01 18:25:57 +0200 |
commit | 9a521681ff8614beb8e2c566cf3c475baca22169 (patch) | |
tree | 77365cb808a255eb53889725bfce775b5090330e /git/test/test_commit.py | |
parent | bdf1e68f6bec679edc3feb455596e18c387879c4 (diff) | |
download | gitpython-9a521681ff8614beb8e2c566cf3c475baca22169.tar.gz |
io, #519: ALL open() --> with open()
+ Some cases had restructuring of code.
Diffstat (limited to 'git/test/test_commit.py')
-rw-r--r-- | git/test/test_commit.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git/test/test_commit.py b/git/test/test_commit.py index 33f8081c..66d988a3 100644 --- a/git/test/test_commit.py +++ b/git/test/test_commit.py @@ -313,14 +313,16 @@ class TestCommit(TestBase): def test_invalid_commit(self): cmt = self.rorepo.commit() - cmt._deserialize(open(fixture_path('commit_invalid_data'), 'rb')) + with open(fixture_path('commit_invalid_data'), 'rb') as fd: + cmt._deserialize(fd) self.assertEqual(cmt.author.name, u'E.Azer Ko�o�o�oculu', cmt.author.name) self.assertEqual(cmt.author.email, 'azer@kodfabrik.com', cmt.author.email) def test_gpgsig(self): cmt = self.rorepo.commit() - cmt._deserialize(open(fixture_path('commit_with_gpgsig'), 'rb')) + with open(fixture_path('commit_with_gpgsig'), 'rb') as fd: + cmt._deserialize(fd) fixture_sig = """-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) |