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
a2719779
Commit
a2719779
authored
Mar 06, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract install_target as fixture
parent
ac3e0877
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+8
-12
No files found.
setuptools/tests/test_easy_install.py
View file @
a2719779
...
...
@@ -188,20 +188,23 @@ class TestUserInstallTest:
f
.
write
(
'Name: foo
\
n
'
)
return
str
(
tmpdir
)
def
test_local_index
(
self
,
foo_package
):
@
pytest
.
fixture
()
def
install_target
(
self
,
tmpdir
):
return
str
(
tmpdir
)
def
test_local_index
(
self
,
foo_package
,
install_target
):
"""
The local index must be used when easy_install locates installed
packages.
"""
target
=
tempfile
.
mkdtemp
()
sys
.
path
.
append
(
target
)
sys
.
path
.
append
(
install_target
)
old_ppath
=
os
.
environ
.
get
(
'PYTHONPATH'
)
os
.
environ
[
'PYTHONPATH'
]
=
os
.
path
.
pathsep
.
join
(
sys
.
path
)
try
:
dist
=
Distribution
()
dist
.
script_name
=
'setup.py'
cmd
=
ei
.
easy_install
(
dist
)
cmd
.
install_dir
=
target
cmd
.
install_dir
=
install_
target
cmd
.
args
=
[
'foo'
]
cmd
.
ensure_finalized
()
cmd
.
local_index
.
scan
([
foo_package
])
...
...
@@ -210,14 +213,7 @@ class TestUserInstallTest:
expected
=
os
.
path
.
normcase
(
os
.
path
.
realpath
(
foo_package
))
assert
actual
==
expected
finally
:
sys
.
path
.
remove
(
target
)
for
basedir
in
[
target
,
]:
if
not
os
.
path
.
exists
(
basedir
)
or
not
os
.
path
.
isdir
(
basedir
):
continue
try
:
shutil
.
rmtree
(
basedir
)
except
:
pass
sys
.
path
.
remove
(
install_target
)
if
old_ppath
is
not
None
:
os
.
environ
[
'PYTHONPATH'
]
=
old_ppath
else
:
...
...
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