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
4cd8b93b
Commit
4cd8b93b
authored
Jul 12, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use simple asserts. pytest handles this nicely. Removes broken _assertIn.
parent
f420ad2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
setuptools/tests/test_resources.py
setuptools/tests/test_resources.py
+2
-9
No files found.
setuptools/tests/test_resources.py
View file @
4cd8b93b
...
...
@@ -575,13 +575,6 @@ class NamespaceTests(TestCase):
pkg_resources
.
_namespace_packages
=
self
.
_ns_pkgs
.
copy
()
sys
.
path
=
self
.
_prev_sys_path
[:]
def
_assertIn
(
self
,
member
,
container
):
""" assertIn and assertTrue does not exist in Python2.3"""
if
member
not
in
container
:
standardMsg
=
'%s not found in %s'
%
(
safe_repr
(
member
),
safe_repr
(
container
))
self
.
fail
(
self
.
_formatMessage
(
msg
,
standardMsg
))
def
test_two_levels_deep
(
self
):
"""
Test nested namespace packages
...
...
@@ -605,13 +598,13 @@ class NamespaceTests(TestCase):
pkg2_init
.
write
(
ns_str
)
pkg2_init
.
close
()
import
pkg1
self
.
_assertIn
(
"pkg1"
,
pkg_resources
.
_namespace_packages
.
keys
())
assert
"pkg1"
in
pkg_resources
.
_namespace_packages
try
:
import
pkg1.pkg2
except
ImportError
:
self
.
fail
(
"Setuptools tried to import the parent namespace package"
)
# check the _namespace_packages dict
self
.
_assertIn
(
"pkg1.pkg2"
,
pkg_resources
.
_namespace_packages
.
keys
())
assert
"pkg1.pkg2"
in
pkg_resources
.
_namespace_packages
self
.
assertEqual
(
pkg_resources
.
_namespace_packages
[
"pkg1"
],
[
"pkg1.pkg2"
])
# check the __path__ attribute contains both paths
self
.
assertEqual
(
pkg1
.
pkg2
.
__path__
,
[
...
...
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