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
2e077b73
Commit
2e077b73
authored
Jan 01, 2021
by
Sviatoslav Sydorenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make `test_pip_upgrade_from_source` xdist-friendly
parent
08ded165
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
setuptools/tests/fixtures.py
setuptools/tests/fixtures.py
+28
-0
setuptools/tests/test_virtualenv.py
setuptools/tests/test_virtualenv.py
+2
-2
No files found.
setuptools/tests/fixtures.py
View file @
2e077b73
import
pathlib
import
shutil
import
pytest
from
.
import
contexts
SRC_DIR
=
pathlib
.
Path
(
__file__
).
parents
[
2
]
@
pytest
.
fixture
def
user_override
(
monkeypatch
):
"""
...
...
@@ -21,3 +27,25 @@ def user_override(monkeypatch):
def
tmpdir_cwd
(
tmpdir
):
with
tmpdir
.
as_cwd
()
as
orig
:
yield
orig
@
pytest
.
fixture
def
src_dir
():
"""The project source directory available via fixture."""
return
SRC_DIR
@
pytest
.
fixture
def
tmp_src
(
src_dir
,
tmp_path
):
"""Make a copy of the source dir under `$tmp/src`.
This fixture is useful whenever it's necessary to run `setup.py`
or `pip install` against the source directory when there's no
control over the number of simultaneous invocations. Such
concurrent runs create and delete directories with the same names
under the target directory and so they influence each other's runs
when they are not being executed sequentially.
"""
tmp_src_path
=
tmp_path
/
'src'
shutil
.
copytree
(
src_dir
,
tmp_src_path
)
return
tmp_src_path
setuptools/tests/test_virtualenv.py
View file @
2e077b73
...
...
@@ -85,7 +85,7 @@ def _get_pip_versions():
@
pytest
.
mark
.
parametrize
(
'pip_version'
,
_get_pip_versions
())
def
test_pip_upgrade_from_source
(
pip_version
,
virtualenv
):
def
test_pip_upgrade_from_source
(
pip_version
,
tmp_src
,
virtualenv
):
"""
Check pip can upgrade setuptools from source.
"""
...
...
@@ -104,7 +104,7 @@ def test_pip_upgrade_from_source(pip_version, virtualenv):
virtualenv
.
run
(
' && '
.
join
((
'python setup.py -q sdist -d {dist}'
,
'python setup.py -q bdist_wheel -d {dist}'
,
)).
format
(
dist
=
dist_dir
),
cd
=
SOURCE_DIR
)
)).
format
(
dist
=
dist_dir
),
cd
=
tmp_src
)
sdist
=
glob
.
glob
(
os
.
path
.
join
(
dist_dir
,
'*.zip'
))[
0
]
wheel
=
glob
.
glob
(
os
.
path
.
join
(
dist_dir
,
'*.whl'
))[
0
]
# Then update from wheel.
...
...
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