Fixed some unclosed objects in tests

This commit is contained in:
Andriy Sokolovskiy 2015-07-02 00:37:10 +03:00 committed by Tim Graham
parent 69483e022a
commit b40c551fdf
5 changed files with 25 additions and 18 deletions

View file

@ -633,7 +633,8 @@ class GZipMiddlewareTest(SimpleTestCase):
@staticmethod
def decompress(gzipped_string):
return gzip.GzipFile(mode='rb', fileobj=BytesIO(gzipped_string)).read()
with gzip.GzipFile(mode='rb', fileobj=BytesIO(gzipped_string)) as f:
return f.read()
def test_compress_response(self):
"""