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
3ff6789b
Commit
3ff6789b
authored
Feb 03, 2016
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use py.path objects for cleaner setup
parent
656a5f3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
pkg_resources/tests/test_resources.py
pkg_resources/tests/test_resources.py
+15
-15
No files found.
pkg_resources/tests/test_resources.py
View file @
3ff6789b
...
...
@@ -688,30 +688,30 @@ class TestNamespaces:
Regression test for https://bitbucket.org/pypa/setuptools/issues/207
"""
real_tmpdir
=
str
(
symlinked_tmpdir
.
realpath
())
tmpdir
=
str
(
symlinked_tmpdir
)
site_pkgs
=
[
"site-pkgs"
,
"site-pkgs2"
,
"site-pkgs3"
]
tmpdir
=
symlinked_tmpdir
site_dirs
=
(
tmpdir
/
"site-pkgs"
,
tmpdir
/
"site-pkgs2"
,
tmpdir
/
"site-pkgs3"
,
)
ns_str
=
"__import__('pkg_resources').declare_namespace(__name__)
\
n
"
vers_str
=
"__version__ = %r"
for
idx
,
site
in
enumerate
(
site_
pkg
s
):
for
idx
,
site
in
enumerate
(
site_
dir
s
):
if
idx
>
0
:
sys
.
path
.
append
(
os
.
path
.
join
(
tmpdir
,
site
))
os
.
makedirs
(
os
.
path
.
join
(
tmpdir
,
site
,
"nspkg"
,
"subpkg"
))
with
open
(
os
.
path
.
join
(
tmpdir
,
site
,
"nspkg"
,
"__init__.py"
),
"w"
)
as
f
:
f
.
write
(
ns_str
)
with
open
(
os
.
path
.
join
(
tmpdir
,
site
,
"nspkg"
,
"subpkg"
,
"__init__.py"
),
"w"
)
as
f
:
f
.
write
(
vers_str
%
(
idx
+
1
))
sys
.
path
.
append
(
str
(
site
))
nspkg
=
site
/
'nspkg'
subpkg
=
nspkg
/
'subpkg'
subpkg
.
ensure_dir
()
(
nspkg
/
'__init__.py'
).
write_text
(
ns_str
,
encoding
=
'utf-8'
)
(
subpkg
/
'__init__.py'
).
write_text
(
vers_str
%
(
idx
+
1
),
encoding
=
'utf-8'
)
import
nspkg.subpkg
import
nspkg
expected
=
[
os
.
path
.
join
(
real_tmpdir
,
site
,
"nspkg"
)
for
site
in
site_
pkg
s
str
(
site
.
realpath
()
/
'nspkg'
)
for
site
in
site_
dir
s
]
assert
nspkg
.
__path__
==
expected
assert
nspkg
.
subpkg
.
__version__
==
1
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