summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_egg_info.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-02 10:03:30 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-02 10:03:30 -0500
commit66ed0829c7d9e59592d0d977ac7f51e772b666f8 (patch)
tree8b820d8abfcf5926921570620650c0de9502e8da /setuptools/tests/test_egg_info.py
parente814d51b89cdfb3cd5ec567726c5756f6872041e (diff)
downloadpython-setuptools-git-66ed0829c7d9e59592d0d977ac7f51e772b666f8.tar.gz
Use contexts for tempdir generation
Diffstat (limited to 'setuptools/tests/test_egg_info.py')
-rw-r--r--setuptools/tests/test_egg_info.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 6d51955c..6d7ba345 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -1,10 +1,9 @@
import os
-import tempfile
-import shutil
import stat
from . import environment
from .textwrap import DALS
+from . import contexts
class TestEggInfo:
@@ -32,9 +31,8 @@ class TestEggInfo:
def test_egg_base_installed_egg_info(self, tmpdir_cwd):
self._create_project()
- temp_dir = tempfile.mkdtemp(prefix='setuptools-test.')
- os.chmod(temp_dir, stat.S_IRWXU)
- try:
+ with contexts.tempdir(prefix='setuptools-test.') as temp_dir:
+ os.chmod(temp_dir, stat.S_IRWXU)
paths = {}
for dirname in ['home', 'lib', 'scripts', 'data', 'egg-base']:
paths[dirname] = os.path.join(temp_dir, dirname)
@@ -70,5 +68,3 @@ class TestEggInfo:
'top_level.txt',
]
assert egg_info == expected
- finally:
- shutil.rmtree(temp_dir)