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
7c3a3817
Commit
7c3a3817
authored
Aug 08, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests capturing expected distutils behavior. Ref #417.
parent
5e60dc50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
setuptools/tests/test_distutils_adoption.py
setuptools/tests/test_distutils_adoption.py
+37
-0
No files found.
setuptools/tests/test_distutils_adoption.py
0 → 100644
View file @
7c3a3817
import
os
import
pytest
@
pytest
.
fixture
def
env
(
virtualenv
):
virtualenv
.
run
([
'pip'
,
'uninstall'
,
'-y'
,
'setuptools'
])
virtualenv
.
run
([
'pip'
,
'install'
,
os
.
getcwd
()])
return
virtualenv
def
find_distutils
(
env
,
imports
=
'distutils'
):
py_cmd
=
'import {imports}; print(distutils.__file__)'
.
format
(
**
locals
())
cmd
=
[
'python'
,
'-c'
,
py_cmd
]
return
env
.
run
(
cmd
,
capture
=
True
,
text
=
True
)
def
test_distutils_stdlib
(
env
):
"""
Ensure stdlib distutils is used when appropriate.
"""
assert
'.env'
not
in
find_distutils
(
env
).
split
(
os
.
sep
)
def
test_distutils_local_with_setuptools
(
env
):
"""
Ensure local distutils is used when appropriate.
"""
env
.
env
.
update
(
SETUPTOOLS_USE_DISTUTILS
=
'local'
)
loc
=
find_distutils
(
env
,
imports
=
'setuptools, distutils'
)
assert
'.env'
in
loc
.
split
(
os
.
sep
)
@
pytest
.
mark
.
xfail
(
reason
=
"#2259"
)
def
test_distutils_local
(
env
):
env
.
env
.
update
(
SETUPTOOLS_USE_DISTUTILS
=
'local'
)
assert
'.env'
in
find_distutils
(
env
).
split
(
os
.
sep
)
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