summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_config.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-10-02 22:37:51 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-10-02 22:37:51 (GMT)
commit641b1de2afece39c3a18f42d5eb5c8708f559aa7 (patch)
treec7be192b9d7218421f24553f0a5cf489ab42e8ac /Lib/distutils/tests/test_config.py
parentd3c87657ba55063e3b2157c4bcbfee57b0887f5b (diff)
downloadcpython-641b1de2afece39c3a18f42d5eb5c8708f559aa7.zip
cpython-641b1de2afece39c3a18f42d5eb5c8708f559aa7.tar.gz
cpython-641b1de2afece39c3a18f42d5eb5c8708f559aa7.tar.bz2
fixed the distutils tests that were not writing in temp
Diffstat (limited to 'Lib/distutils/tests/test_config.py')
-rw-r--r--Lib/distutils/tests/test_config.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/distutils/tests/test_config.py b/Lib/distutils/tests/test_config.py
index cae7689..23291da 100644
--- a/Lib/distutils/tests/test_config.py
+++ b/Lib/distutils/tests/test_config.py
@@ -49,13 +49,14 @@ class PyPIRCCommandTestCase(support.TempdirManager, unittest.TestCase):
def setUp(self):
"""Patches the environment."""
+ super(PyPIRCCommandTestCase, self).setUp()
if os.environ.has_key('HOME'):
self._old_home = os.environ['HOME']
else:
self._old_home = None
- curdir = os.path.dirname(__file__)
- os.environ['HOME'] = curdir
- self.rc = os.path.join(curdir, '.pypirc')
+ tempdir = self.mkdtemp()
+ os.environ['HOME'] = tempdir
+ self.rc = os.path.join(tempdir, '.pypirc')
self.dist = Distribution()
class command(PyPIRCCommand):
@@ -74,9 +75,8 @@ class PyPIRCCommandTestCase(support.TempdirManager, unittest.TestCase):
del os.environ['HOME']
else:
os.environ['HOME'] = self._old_home
- if os.path.exists(self.rc):
- os.remove(self.rc)
set_threshold(self.old_threshold)
+ super(PyPIRCCommandTestCase, self).tearDown()
def test_server_registration(self):
# This test makes sure PyPIRCCommand knows how to: