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
e61c3210
Commit
e61c3210
authored
Jun 15, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merging integration tests from Doug Hellmann
parents
087c2032
def90a0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
0 deletions
+106
-0
.gitignore
.gitignore
+18
-0
setuptools/tests/test_integration.py
setuptools/tests/test_integration.py
+88
-0
No files found.
.gitignore
0 → 100644
View file @
e61c3210
*.pyc
*~
*.swp
.coverage
.tox
distribute.egg-info
setuptools.egg-info
build
dist
lib
bin
include
\.Python
*.swp
CHANGES (links).txt
.git*
py-*.egg
pytest-*.egg
setuptools/tests/test_integration.py
0 → 100644
View file @
e61c3210
"""Run some integration tests.
Try to install a few packages.
"""
import
glob
import
os
import
shutil
import
site
import
sys
import
tempfile
import
pytest
from
setuptools.command.easy_install
import
easy_install
from
setuptools.command
import
easy_install
as
easy_install_pkg
from
setuptools.dist
import
Distribution
@
pytest
.
fixture
def
install_context
(
request
):
"""Fixture to set up temporary installation directory.
"""
# Save old values so we can restore them.
new_cwd
=
tempfile
.
mkdtemp
()
old_cwd
=
os
.
getcwd
()
old_enable_site
=
site
.
ENABLE_USER_SITE
old_file
=
easy_install_pkg
.
__file__
old_base
=
site
.
USER_BASE
old_site
=
site
.
USER_SITE
old_ppath
=
os
.
environ
.
get
(
'PYTHONPATH'
)
def
fin
():
os
.
chdir
(
old_cwd
)
shutil
.
rmtree
(
new_cwd
)
shutil
.
rmtree
(
site
.
USER_BASE
)
shutil
.
rmtree
(
site
.
USER_SITE
)
site
.
USER_BASE
=
old_base
site
.
USER_SITE
=
old_site
site
.
ENABLE_USER_SITE
=
old_enable_site
easy_install_pkg
.
__file__
=
old_file
os
.
environ
[
'PYTHONPATH'
]
=
old_ppath
or
''
request
.
addfinalizer
(
fin
)
# Change the environment and site settings to control where the
# files are installed and ensure we do not overwrite anything.
site
.
USER_BASE
=
tempfile
.
mkdtemp
()
site
.
USER_SITE
=
tempfile
.
mkdtemp
()
easy_install_pkg
.
__file__
=
site
.
USER_SITE
os
.
chdir
(
new_cwd
)
install_dir
=
tempfile
.
mkdtemp
()
sys
.
path
.
append
(
install_dir
)
os
.
environ
[
'PYTHONPATH'
]
=
os
.
path
.
pathsep
.
join
(
sys
.
path
)
# Set up the command for performing the installation.
dist
=
Distribution
()
cmd
=
easy_install
(
dist
)
cmd
.
install_dir
=
install_dir
return
cmd
def
_install_one
(
requirement
,
cmd
,
pkgname
,
modulename
):
cmd
.
args
=
[
requirement
]
cmd
.
ensure_finalized
()
cmd
.
run
()
target
=
cmd
.
install_dir
dest_path
=
glob
.
glob
(
os
.
path
.
join
(
target
,
pkgname
+
'*.egg'
))
assert
dest_path
assert
os
.
path
.
exists
(
os
.
path
.
join
(
dest_path
[
0
],
pkgname
,
modulename
))
def
test_stevedore
(
install_context
):
_install_one
(
'stevedore'
,
install_context
,
'stevedore'
,
'extension.py'
)
@
pytest
.
mark
.
xfail
def
test_virtualenvwrapper
(
install_context
):
_install_one
(
'virtualenvwrapper'
,
install_context
,
'virtualenvwrapper'
,
'hook_loader.py'
)
@
pytest
.
mark
.
xfail
def
test_pbr
(
install_context
):
_install_one
(
'pbr'
,
install_context
,
'pbr'
,
'core.py'
)
@
pytest
.
mark
.
xfail
def
test_python_novaclient
(
install_context
):
_install_one
(
'python-novaclient'
,
install_context
,
'novaclient'
,
'base.py'
)
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