aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-06-15 15:34:53 +0100
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-06-15 15:34:53 +0100
commit8e657eac1ef02faedca99df319fff6b63f4a4305 (patch)
treef3f2ed97342421c6b65c9caaab8ae5d830f04059 /setuptools/tests/test_easy_install.py
parentc04abca662dcbffd00d928e06fbf32b9f49f8e57 (diff)
downloadexternal_python_setuptools-8e657eac1ef02faedca99df319fff6b63f4a4305.tar.gz
external_python_setuptools-8e657eac1ef02faedca99df319fff6b63f4a4305.tar.bz2
external_python_setuptools-8e657eac1ef02faedca99df319fff6b63f4a4305.zip
Initial commit. All tests pass on 2.7, 3.2 and 3.3, though there are some atexit errors in the multiprocessing module in 2.7/3.2 (seemingly unrelated to setuptools).
--HG-- branch : single-codebase
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 395056e7..66d43b62 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -8,10 +8,9 @@ import unittest
import site
import textwrap
import tarfile
-import urlparse
-import StringIO
import distutils.core
+from setuptools.compat import StringIO, BytesIO, next, urlparse
from setuptools.sandbox import run_setup, SandboxViolation
from setuptools.command.easy_install import easy_install, fix_jython_executable, get_script_args
from setuptools.command.easy_install import PthDistributions
@@ -78,7 +77,7 @@ class TestEasyInstallTest(unittest.TestCase):
old_platform = sys.platform
try:
- name, script = [i for i in get_script_args(dist).next()][0:2]
+ name, script = [i for i in next(get_script_args(dist))][0:2]
finally:
sys.platform = old_platform
@@ -104,8 +103,7 @@ class TestEasyInstallTest(unittest.TestCase):
cmd.install_dir = os.path.join(tempfile.mkdtemp(), 'ok')
cmd.args = ['ok']
cmd.ensure_finalized()
- keys = cmd.package_index.scanned_urls.keys()
- keys.sort()
+ keys = sorted(cmd.package_index.scanned_urls.keys())
self.assertEqual(keys, ['link1', 'link2'])
@@ -269,8 +267,8 @@ class TestUserInstallTest(unittest.TestCase):
old_stdout = sys.stdout
old_stderr = sys.stderr
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
try:
reset_setup_stop_context(
lambda: run_setup(test_setup_py, ['install'])
@@ -294,7 +292,7 @@ class TestSetupRequires(unittest.TestCase):
p_index = setuptools.tests.server.MockServer()
p_index.start()
netloc = 1
- p_index_loc = urlparse.urlparse(p_index.url)[netloc]
+ p_index_loc = urlparse(p_index.url)[netloc]
if p_index_loc.endswith(':0'):
# Some platforms (Jython) don't find a port to which to bind,
# so skip this test for them.
@@ -361,9 +359,9 @@ def make_trivial_sdist(dist_path, setup_py):
setup_py_file = tarfile.TarInfo(name='setup.py')
try:
# Python 3 (StringIO gets converted to io module)
- MemFile = StringIO.BytesIO
+ MemFile = BytesIO
except AttributeError:
- MemFile = StringIO.StringIO
+ MemFile = StringIO
setup_py_bytes = MemFile(setup_py.encode('utf-8'))
setup_py_file.size = len(setup_py_bytes.getvalue())
dist = tarfile.open(dist_path, 'w:gz')