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:
...
@@ -688,30 +688,30 @@ class TestNamespaces:
Regression test for https://bitbucket.org/pypa/setuptools/issues/207
Regression test for https://bitbucket.org/pypa/setuptools/issues/207
"""
"""
real_tmpdir
=
str
(
symlinked_tmpdir
.
realpath
())
tmpdir
=
symlinked_tmpdir
tmpdir
=
str
(
symlinked_tmpdir
)
site_dirs
=
(
site_pkgs
=
[
"site-pkgs"
,
"site-pkgs2"
,
"site-pkgs3"
]
tmpdir
/
"site-pkgs"
,
tmpdir
/
"site-pkgs2"
,
tmpdir
/
"site-pkgs3"
,
)
ns_str
=
"__import__('pkg_resources').declare_namespace(__name__)
\
n
"
ns_str
=
"__import__('pkg_resources').declare_namespace(__name__)
\
n
"
vers_str
=
"__version__ = %r"
vers_str
=
"__version__ = %r"
for
idx
,
site
in
enumerate
(
site_
pkg
s
):
for
idx
,
site
in
enumerate
(
site_
dir
s
):
if
idx
>
0
:
if
idx
>
0
:
sys
.
path
.
append
(
os
.
path
.
join
(
tmpdir
,
site
))
sys
.
path
.
append
(
str
(
site
))
os
.
makedirs
(
os
.
path
.
join
(
tmpdir
,
site
,
"nspkg"
,
"subpkg"
))
nspkg
=
site
/
'nspkg'
with
open
(
os
.
path
.
join
(
tmpdir
,
site
,
"nspkg"
,
subpkg
=
nspkg
/
'subpkg'
"__init__.py"
),
"w"
)
as
f
:
subpkg
.
ensure_dir
()
f
.
write
(
ns_str
)
(
nspkg
/
'__init__.py'
).
write_text
(
ns_str
,
encoding
=
'utf-8'
)
(
subpkg
/
'__init__.py'
).
write_text
(
vers_str
%
(
idx
+
1
),
encoding
=
'utf-8'
)
with
open
(
os
.
path
.
join
(
tmpdir
,
site
,
"nspkg"
,
"subpkg"
,
"__init__.py"
),
"w"
)
as
f
:
f
.
write
(
vers_str
%
(
idx
+
1
))
import
nspkg.subpkg
import
nspkg.subpkg
import
nspkg
import
nspkg
expected
=
[
expected
=
[
os
.
path
.
join
(
real_tmpdir
,
site
,
"nspkg"
)
str
(
site
.
realpath
()
/
'nspkg'
)
for
site
in
site_
pkg
s
for
site
in
site_
dir
s
]
]
assert
nspkg
.
__path__
==
expected
assert
nspkg
.
__path__
==
expected
assert
nspkg
.
subpkg
.
__version__
==
1
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