aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-01-04 21:00:47 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-01-04 21:00:47 -0500
commitd9184f7b8f0b9405f68ea45dbd574aad6a08666d (patch)
treee93b4d6ca527f8b22c4a11b978864f61ebe02405 /setuptools/tests/test_easy_install.py
parent6bdbe8957d8c8d293e3fea3fa4baf45eb7c3a3a4 (diff)
parentb639cf0fa905f6fda3879c991197b759aaa20091 (diff)
downloadexternal_python_setuptools-d9184f7b8f0b9405f68ea45dbd574aad6a08666d.tar.gz
external_python_setuptools-d9184f7b8f0b9405f68ea45dbd574aad6a08666d.tar.bz2
external_python_setuptools-d9184f7b8f0b9405f68ea45dbd574aad6a08666d.zip
Merge feature/issue-22919.3b1
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index f0330f17..94e317b3 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -14,6 +14,10 @@ import tarfile
import logging
import itertools
import distutils.errors
+import io
+
+from setuptools.extern import six
+from setuptools.extern.six.moves import urllib
import pytest
try:
@@ -22,8 +26,6 @@ except ImportError:
import mock
from setuptools import sandbox
-from setuptools import compat
-from setuptools.compat import StringIO, BytesIO, urlparse
from setuptools.sandbox import run_setup
import setuptools.command.easy_install as ei
from setuptools.command.easy_install import PthDistributions
@@ -272,7 +274,7 @@ class TestSetupRequires:
p_index = setuptools.tests.server.MockServer()
p_index.start()
netloc = 1
- p_index_loc = urlparse(p_index.url)[netloc]
+ p_index_loc = urllib.parse.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.
@@ -391,12 +393,7 @@ 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 = BytesIO
- except AttributeError:
- MemFile = StringIO
- setup_py_bytes = MemFile(setup_py.encode('utf-8'))
+ setup_py_bytes = io.BytesIO(setup_py.encode('utf-8'))
setup_py_file.size = len(setup_py_bytes.getvalue())
with tarfile_open(dist_path, 'w:gz') as dist:
dist.addfile(setup_py_file, fileobj=setup_py_bytes)
@@ -431,7 +428,7 @@ class TestScriptHeader:
assert actual == expected
@pytest.mark.xfail(
- compat.PY3 and is_ascii,
+ six.PY3 and is_ascii,
reason="Test fails in this locale on Python 3"
)
@mock.patch.dict(sys.modules, java=mock.Mock(lang=mock.Mock(System=