From a3966d17f6f7f0769b83d5ef56fc8f97f6a4b415 Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Wed, 24 Oct 2012 03:19:23 +0200 Subject: Issue #329: Properly close files created by tests for compatibility with Jython. --HG-- branch : distribute extra : rebase_source : 09c503106ef73b7694e13443ae899666652922a4 --- CHANGES.txt | 6 ++++++ setuptools/tests/test_dist_info.py | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 12b4907a..9513ed45 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,12 @@ CHANGES ======= +------ +0.6.31 +------ + +* Issue #329: Properly close files created by tests for compatibility with Jython. + ------ 0.6.30 ------ diff --git a/setuptools/tests/test_dist_info.py b/setuptools/tests/test_dist_info.py index 623ccc47..fcb78c36 100644 --- a/setuptools/tests/test_dist_info.py +++ b/setuptools/tests/test_dist_info.py @@ -50,7 +50,8 @@ class TestDistInfo(unittest.TestCase): versioned = os.path.join(self.tmpdir, 'VersionedDistribution-2.718.dist-info') os.mkdir(versioned) - open(os.path.join(versioned, 'METADATA'), 'w+').write(DALS( + metadata_file = open(os.path.join(versioned, 'METADATA'), 'w+') + metadata_file.write(DALS( """ Metadata-Version: 1.2 Name: VersionedDistribution @@ -58,11 +59,13 @@ class TestDistInfo(unittest.TestCase): Provides-Extra: baz Requires-Dist: quux (>=1.1); extra == 'baz' """)) + metadata_file.close() unversioned = os.path.join(self.tmpdir, 'UnversionedDistribution.dist-info') os.mkdir(unversioned) - open(os.path.join(unversioned, 'METADATA'), 'w+').write(DALS( + metadata_file = open(os.path.join(unversioned, 'METADATA'), 'w+') + metadata_file.write(DALS( """ Metadata-Version: 1.2 Name: UnversionedDistribution @@ -71,6 +74,7 @@ class TestDistInfo(unittest.TestCase): Provides-Extra: baz Requires-Dist: quux (>=1.1); extra == 'baz' """)) + metadata_file.close() def tearDown(self): shutil.rmtree(self.tmpdir) -- cgit v1.2.3