summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-09-04 10:22:54 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-09-04 10:22:54 -0400
commitfc4d9828768ceebd2f9337481450c88376c013e9 (patch)
tree6dff622c50739ca19fdfbecf1008a42589d37b57 /setuptools/tests/test_easy_install.py
parent7bb73a477de24069002516eb6eb1d755bed9d65b (diff)
parent03d36b9edb53e266a0b4b836e1e3178f989a0781 (diff)
downloadpython-setuptools-git-feature/implicit-bootstrap.tar.gz
Merge branch 'master' into feature/implicit-bootstrapfeature/implicit-bootstrap
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py41
1 files changed, 8 insertions, 33 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 534392b9..26a5e9a6 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -1,7 +1,5 @@
-# -*- coding: utf-8 -*-
"""Easy install Tests
"""
-from __future__ import absolute_import, unicode_literals
import sys
import os
@@ -16,8 +14,7 @@ import io
import zipfile
import mock
import time
-
-from setuptools.extern import six
+import re
import pytest
@@ -40,8 +37,6 @@ from . import contexts
from .files import build_files
from .textwrap import DALS
-__metaclass__ = type
-
class FakeDist:
def get_entry_map(self, group):
@@ -61,35 +56,17 @@ SETUP_PY = DALS("""
class TestEasyInstallTest:
- def test_install_site_py(self, tmpdir):
- dist = Distribution()
- cmd = ei.easy_install(dist)
- cmd.sitepy_installed = False
- cmd.install_dir = str(tmpdir)
- cmd.install_site_py()
- assert (tmpdir / 'site.py').exists()
-
def test_get_script_args(self):
header = ei.CommandSpec.best().from_environment().as_header()
- expected = header + DALS(r"""
- # EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name'
- __requires__ = 'spec'
- import re
- import sys
- from pkg_resources import load_entry_point
-
- if __name__ == '__main__':
- sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
- sys.exit(
- load_entry_point('spec', 'console_scripts', 'name')()
- )
- """) # noqa: E501
dist = FakeDist()
-
args = next(ei.ScriptWriter.get_args(dist))
name, script = itertools.islice(args, 2)
-
- assert script == expected
+ assert script.startswith(header)
+ assert "'spec'" in script
+ assert "'console_scripts'" in script
+ assert "'name'" in script
+ assert re.search(
+ '^# EASY-INSTALL-ENTRY-SCRIPT', script, flags=re.MULTILINE)
def test_no_find_links(self):
# new option '--no-find-links', that blocks find-links added at
@@ -738,7 +715,7 @@ class TestSetupRequires:
dep_2_0_url=dep_2_0_url,
dep_2_0_sdist=dep_2_0_sdist,
dep_2_0_python_requires=dep_2_0_python_requires,
- ), 'utf-8')
+ ), 'utf-8')
index_url = path_to_url(str(index))
with contexts.save_pkg_resources_state():
test_pkg = create_setup_requires_package(
@@ -1001,8 +978,6 @@ def create_setup_requires_package(path, distname='foobar', version='0.1',
)
class TestScriptHeader:
non_ascii_exe = '/Users/José/bin/python'
- if six.PY2:
- non_ascii_exe = non_ascii_exe.encode('utf-8')
exe_with_spaces = r'C:\Program Files\Python36\python.exe'
def test_get_script_header(self):