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
9744cf2e
Commit
9744cf2e
authored
Nov 28, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite test to use distutils' install_egg_info to generate the metadata.
parent
41868fe7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
pkg_resources/tests/test_pkg_resources.py
pkg_resources/tests/test_pkg_resources.py
+11
-10
No files found.
pkg_resources/tests/test_pkg_resources.py
View file @
9744cf2e
...
...
@@ -6,9 +6,10 @@ import datetime
import
time
import
subprocess
import
stat
import
distutils.dist
import
distutils.command.install_egg_info
import
pytest
import
py
import
pkg_resources
...
...
@@ -117,7 +118,7 @@ class TestIndependence:
class
TestDeepVersionLookup
(
object
):
class
TestDeepVersionLookup
Distutils
(
object
):
@
pytest
.
fixture
def
env
(
self
,
tmpdir
):
...
...
@@ -140,16 +141,16 @@ class TestDeepVersionLookup(object):
def
create_foo_pkg
(
self
,
env
,
version
):
"""
Create a foo package installed to env.paths['lib']
Create a foo package installed
(distutils-style)
to env.paths['lib']
as version.
"""
safe_version
=
pkg_resources
.
safe_version
(
version
)
lib
=
py
.
path
.
local
(
env
.
paths
[
'lib'
]
)
egg_info
=
lib
/
'foo-'
+
safe_version
+
'.egg-info'
egg_info
.
mkdir
()
pkg_info
=
egg_info
/
'PKG_INFO'
with
pkg_info
.
open
(
'w'
)
as
strm
:
strm
.
write
(
'version: '
+
version
)
attrs
=
dict
(
name
=
'foo'
,
version
=
version
)
dist
=
distutils
.
dist
.
Distribution
(
attrs
)
iei_cmd
=
distutils
.
command
.
install_egg_info
.
install_egg_info
(
dist
)
iei_cmd
.
initialize_options
()
iei_cmd
.
install_dir
=
env
.
paths
[
'lib'
]
iei_cmd
.
finalize_options
()
iei_cmd
.
run
(
)
def
test_version_resolved_from_egg_info
(
self
,
env
):
version
=
'1.11.0.dev0+2329eae'
...
...
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