aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorguyroz <none@none>2011-09-19 23:49:25 +0300
committerguyroz <none@none>2011-09-19 23:49:25 +0300
commit6aea437b8fdf7db27d99a3d725231896dd7343cb (patch)
treec911750c126529cf971970cc427237d83a14774a /setuptools/tests/test_easy_install.py
parentc0032c0de589c7f8f633314cae891bbb2191dbce (diff)
parent8b25dd9f9edc2f2506efb5a471f2facdf4082a31 (diff)
downloadexternal_python_setuptools-6aea437b8fdf7db27d99a3d725231896dd7343cb.tar.gz
external_python_setuptools-6aea437b8fdf7db27d99a3d725231896dd7343cb.tar.bz2
external_python_setuptools-6aea437b8fdf7db27d99a3d725231896dd7343cb.zip
fixing tests
--HG-- branch : distribute extra : rebase_source : 5d3983c1447f6389c00b416e5942f1764eaf9ece
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 85616605..1ae0ba70 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -67,7 +67,7 @@ class TestEasyInstallTest(unittest.TestCase):
old_platform = sys.platform
try:
- name, script = get_script_args(dist).next()
+ name, script = get_script_args(dist).next()[0:2]
finally:
sys.platform = old_platform
@@ -141,9 +141,13 @@ class TestPTHFileWriter(unittest.TestCase):
self.assert_(pth.dirty)
def test_add_from_site_is_ignored(self):
- pth = PthDistributions('does-not_exist', ['/test/location/does-not-have-to-exist'])
+ if os.name != 'nt':
+ location = '/test/location/does-not-have-to-exist'
+ else:
+ location = 'c:\\does_not_exist'
+ pth = PthDistributions('does-not_exist', [location, ])
self.assert_(not pth.dirty)
- pth.add(PRDistribution('/test/location/does-not-have-to-exist'))
+ pth.add(PRDistribution(location))
self.assert_(not pth.dirty)
@@ -221,7 +225,7 @@ class TestUserInstallTest(unittest.TestCase):
sys.path.append(target)
old_ppath = os.environ.get('PYTHONPATH')
- os.environ['PYTHONPATH'] = ':'.join(sys.path)
+ os.environ['PYTHONPATH'] = os.path.pathsep.join(sys.path)
try:
dist = Distribution()
dist.script_name = 'setup.py'
@@ -234,8 +238,13 @@ class TestUserInstallTest(unittest.TestCase):
self.assertEquals(res.location, new_location)
finally:
sys.path.remove(target)
- shutil.rmtree(new_location)
- shutil.rmtree(target)
+ for basedir in [new_location, target, ]:
+ if not os.path.exists(basedir) or not os.path.isdir(basedir):
+ continue
+ try:
+ shutil.rmtree(basedir)
+ except:
+ pass
if old_ppath is not None:
os.environ['PYTHONPATH'] = old_ppath
else: