diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-03-13 15:35:59 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-03-13 15:35:59 +0000 |
commit | 91b259141168df31a8f84f013d3789e8dabb0cc2 (patch) | |
tree | ded771b1e2991b9771c04c88690d03e58e5c3df5 /morphlib/bins_tests.py | |
parent | 9f053dc019f7de13fa8acd3ec049a20e680d0ad6 (diff) | |
download | morph-91b259141168df31a8f84f013d3789e8dabb0cc2.tar.gz |
Rewrite test to not use with for gzip.GzipFile
We (still) need this to work in Debian squeeze, for bootstrapping,
and squeeze has Python 2.6, which has a GzipFile that does not
implement the "with protocol". Boo hiss.
Diffstat (limited to 'morphlib/bins_tests.py')
-rw-r--r-- | morphlib/bins_tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/morphlib/bins_tests.py b/morphlib/bins_tests.py index d7ed1656..edefb092 100644 --- a/morphlib/bins_tests.py +++ b/morphlib/bins_tests.py @@ -137,8 +137,9 @@ class ChunkTests(BinsTest): def test_does_not_compress_artifact(self): self.create_chunk(['bin']) - with gzip.open(self.chunk_file) as f: - self.assertRaises(IOError, f.read) + f = gzip.open(self.chunk_file) + self.assertRaises(IOError, f.read) + f.close() class ExtractTests(unittest.TestCase): |