diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 13:14:31 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 13:14:31 -0500 |
commit | afedfedb4669e8f4ab1677bdb71bb9895fb2dc13 (patch) | |
tree | 3fc7ddd76d15e32d16ca6c243a04bb16d9a5af1e /setuptools/tests/test_upload_docs.py | |
parent | 8aee42417b6635979dc0da1beba3eae4fc6c3c7c (diff) | |
download | external_python_setuptools-afedfedb4669e8f4ab1677bdb71bb9895fb2dc13.tar.gz external_python_setuptools-afedfedb4669e8f4ab1677bdb71bb9895fb2dc13.tar.bz2 external_python_setuptools-afedfedb4669e8f4ab1677bdb71bb9895fb2dc13.zip |
Open zip file in context
Diffstat (limited to 'setuptools/tests/test_upload_docs.py')
-rw-r--r-- | setuptools/tests/test_upload_docs.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/setuptools/tests/test_upload_docs.py b/setuptools/tests/test_upload_docs.py index ea5c3587..85f6d864 100644 --- a/setuptools/tests/test_upload_docs.py +++ b/setuptools/tests/test_upload_docs.py @@ -54,8 +54,5 @@ class TestUploadDocsTest: assert zipfile.is_zipfile(tmp_file) - zip_file = zipfile.ZipFile(tmp_file) - - assert zip_file.namelist() == ['index.html'] - - zip_file.close() + with zipfile.ZipFile(tmp_file) as zip_file: + assert zip_file.namelist() == ['index.html'] |