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
ac3e0877
Commit
ac3e0877
authored
Mar 06, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract fixture for foo_package.
parent
85dd199e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+11
-9
No files found.
setuptools/tests/test_easy_install.py
View file @
ac3e0877
...
...
@@ -181,17 +181,19 @@ class TestUserInstallTest:
logging
.
basicConfig
(
level
=
logging
.
INFO
,
stream
=
sys
.
stderr
)
log
.
info
(
'this should not break'
)
def
test_local_index
(
self
):
@
pytest
.
fixture
()
def
foo_package
(
self
,
tmpdir
):
egg_file
=
tmpdir
/
'foo-1.0.egg-info'
with
egg_file
.
open
(
'w'
)
as
f
:
f
.
write
(
'Name: foo
\
n
'
)
return
str
(
tmpdir
)
def
test_local_index
(
self
,
foo_package
):
"""
The local index must be used when easy_install locates installed
packages.
"""
new_location
=
tempfile
.
mkdtemp
()
target
=
tempfile
.
mkdtemp
()
egg_file
=
os
.
path
.
join
(
new_location
,
'foo-1.0.egg-info'
)
with
open
(
egg_file
,
'w'
)
as
f
:
f
.
write
(
'Name: foo
\
n
'
)
sys
.
path
.
append
(
target
)
old_ppath
=
os
.
environ
.
get
(
'PYTHONPATH'
)
os
.
environ
[
'PYTHONPATH'
]
=
os
.
path
.
pathsep
.
join
(
sys
.
path
)
...
...
@@ -202,14 +204,14 @@ class TestUserInstallTest:
cmd
.
install_dir
=
target
cmd
.
args
=
[
'foo'
]
cmd
.
ensure_finalized
()
cmd
.
local_index
.
scan
([
new_location
])
cmd
.
local_index
.
scan
([
foo_package
])
res
=
cmd
.
easy_install
(
'foo'
)
actual
=
os
.
path
.
normcase
(
os
.
path
.
realpath
(
res
.
location
))
expected
=
os
.
path
.
normcase
(
os
.
path
.
realpath
(
new_location
))
expected
=
os
.
path
.
normcase
(
os
.
path
.
realpath
(
foo_package
))
assert
actual
==
expected
finally
:
sys
.
path
.
remove
(
target
)
for
basedir
in
[
new_location
,
target
,
]:
for
basedir
in
[
target
,
]:
if
not
os
.
path
.
exists
(
basedir
)
or
not
os
.
path
.
isdir
(
basedir
):
continue
try
:
...
...
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