Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
01fd232d
Commit
01fd232d
authored
Aug 21, 2018
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delint
parent
9aa447ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
26 deletions
+34
-26
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+34
-26
No files found.
setuptools/tests/test_easy_install.py
View file @
01fd232d
...
...
@@ -80,7 +80,7 @@ class TestEasyInstallTest:
sys.exit(
load_entry_point('spec', 'console_scripts', 'name')()
)
"""
)
"""
)
# noqa: E501
dist
=
FakeDist
()
args
=
next
(
ei
.
ScriptWriter
.
get_args
(
dist
))
...
...
@@ -172,7 +172,8 @@ class TestEasyInstallTest:
return
str
(
sdist
)
@
fail_on_ascii
def
test_unicode_filename_in_sdist
(
self
,
sdist_unicode
,
tmpdir
,
monkeypatch
):
def
test_unicode_filename_in_sdist
(
self
,
sdist_unicode
,
tmpdir
,
monkeypatch
):
"""
The install command should execute correctly even if
the package has unicode filenames.
...
...
@@ -228,7 +229,8 @@ class TestEasyInstallTest:
return
str
(
sdist
)
@
fail_on_ascii
def
test_unicode_content_in_sdist
(
self
,
sdist_unicode_in_script
,
tmpdir
,
monkeypatch
):
def
test_unicode_content_in_sdist
(
self
,
sdist_unicode_in_script
,
tmpdir
,
monkeypatch
):
"""
The install command should execute correctly even if
the package has unicode in scripts.
...
...
@@ -453,8 +455,8 @@ class TestSetupRequires:
dist_file
,
]
with
sandbox
.
save_argv
([
'easy_install'
]):
# attempt to install the dist. It should
fail because
# it doesn't exist.
# attempt to install the dist. It should
#
fail because
it doesn't exist.
with
pytest
.
raises
(
SystemExit
):
easy_install_pkg
.
main
(
ei_params
)
# there should have been two or three requests to the server
...
...
@@ -506,7 +508,8 @@ class TestSetupRequires:
with
contexts
.
save_pkg_resources_state
():
with
contexts
.
tempdir
()
as
temp_dir
:
test_pkg
=
create_setup_requires_package
(
temp_dir
,
use_setup_cfg
=
use_setup_cfg
)
test_pkg
=
create_setup_requires_package
(
temp_dir
,
use_setup_cfg
=
use_setup_cfg
)
test_setup_py
=
os
.
path
.
join
(
test_pkg
,
'setup.py'
)
with
contexts
.
quiet
()
as
(
stdout
,
stderr
):
# Don't even need to install the package, just
...
...
@@ -567,7 +570,8 @@ class TestSetupRequires:
# running the setup.py at all is sufficient
run_setup
(
test_setup_py
,
[
str
(
'--name'
)])
except
pkg_resources
.
VersionConflict
:
self
.
fail
(
'Installing setup.py requirements '
self
.
fail
(
'Installing setup.py requirements '
'caused a VersionConflict'
)
assert
'FAIL'
not
in
stdout
.
getvalue
()
...
...
@@ -578,21 +582,23 @@ class TestSetupRequires:
@
pytest
.
mark
.
parametrize
(
'use_setup_cfg'
,
use_setup_cfg
)
def
test_setup_requires_with_attr_version
(
self
,
use_setup_cfg
):
def
make_dependency_sdist
(
dist_path
,
distname
,
version
):
make_sdist
(
dist_path
,
[
(
'setup.py'
,
DALS
(
"""
import setuptools
setuptools.setup(
name={name!r},
version={version!r},
py_modules=[{name!r}],
)
"""
.
format
(
name
=
distname
,
version
=
version
))),
(
distname
+
'.py'
,
DALS
(
"""
version = 42
"""
))])
files
=
[(
'setup.py'
,
DALS
(
"""
import setuptools
setuptools.setup(
name={name!r},
version={version!r},
py_modules=[{name!r}],
)
"""
.
format
(
name
=
distname
,
version
=
version
)),
),
(
distname
+
'.py'
,
DALS
(
"""
version = 42
"""
),
)]
make_sdist
(
dist_path
,
files
)
with
contexts
.
save_pkg_resources_state
():
with
contexts
.
tempdir
()
as
temp_dir
:
test_pkg
=
create_setup_requires_package
(
...
...
@@ -754,19 +760,21 @@ class TestScriptHeader:
assert
actual
==
expected
def
test_get_script_header_args
(
self
):
expected
=
'#!%s -x
\
n
'
%
ei
.
nt_quote_arg
(
os
.
path
.
normpath
(
sys
.
executable
))
expected
=
'#!%s -x
\
n
'
%
ei
.
nt_quote_arg
(
os
.
path
.
normpath
(
sys
.
executable
))
actual
=
ei
.
ScriptWriter
.
get_script_header
(
'#!/usr/bin/python -x'
)
assert
actual
==
expected
def
test_get_script_header_non_ascii_exe
(
self
):
actual
=
ei
.
ScriptWriter
.
get_script_header
(
'#!/usr/bin/python'
,
actual
=
ei
.
ScriptWriter
.
get_script_header
(
'#!/usr/bin/python'
,
executable
=
self
.
non_ascii_exe
)
expected
=
str
(
'#!%s -x
\
n
'
)
%
self
.
non_ascii_exe
assert
actual
==
expected
def
test_get_script_header_exe_with_spaces
(
self
):
actual
=
ei
.
ScriptWriter
.
get_script_header
(
'#!/usr/bin/python'
,
actual
=
ei
.
ScriptWriter
.
get_script_header
(
'#!/usr/bin/python'
,
executable
=
'"'
+
self
.
exe_with_spaces
+
'"'
)
expected
=
'#!"%s"
\
n
'
%
self
.
exe_with_spaces
assert
actual
==
expected
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment