Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
80e8c998
Commit
80e8c998
authored
Apr 04, 2007
by
Collin Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using test_support.verify().
parent
9475db76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
Lib/test/test___all__.py
Lib/test/test___all__.py
+6
-8
No files found.
Lib/test/test___all__.py
View file @
80e8c998
import
unittest
import
unittest
from
test
import
test_support
from
test.test_support
import
verbose
,
run_unittest
from
test.test_support
import
verify
,
verbose
import
sys
import
sys
import
warnings
import
warnings
...
@@ -22,15 +20,15 @@ class AllTest(unittest.TestCase):
...
@@ -22,15 +20,15 @@ class AllTest(unittest.TestCase):
# Silent fail here seems the best route since some modules
# Silent fail here seems the best route since some modules
# may not be available in all environments.
# may not be available in all environments.
return
return
verify
(
hasattr
(
sys
.
modules
[
modname
],
"__all__"
),
self
.
failUnless
(
hasattr
(
sys
.
modules
[
modname
],
"__all__"
),
"%s has no __all__ attribute"
%
modname
)
"%s has no __all__ attribute"
%
modname
)
names
=
{}
names
=
{}
exec
"from %s import *"
%
modname
in
names
exec
"from %s import *"
%
modname
in
names
if
names
.
has_key
(
"__builtins__"
)
:
if
"__builtins__"
in
names
:
del
names
[
"__builtins__"
]
del
names
[
"__builtins__"
]
keys
=
set
(
names
)
keys
=
set
(
names
)
all
=
set
(
sys
.
modules
[
modname
].
__all__
)
all
=
set
(
sys
.
modules
[
modname
].
__all__
)
verify
(
keys
==
all
,
"%s != %s"
%
(
keys
,
all
)
)
self
.
assertEqual
(
keys
,
all
)
def
test_all
(
self
):
def
test_all
(
self
):
if
not
sys
.
platform
.
startswith
(
'java'
):
if
not
sys
.
platform
.
startswith
(
'java'
):
...
@@ -181,7 +179,7 @@ class AllTest(unittest.TestCase):
...
@@ -181,7 +179,7 @@ class AllTest(unittest.TestCase):
def
test_main
():
def
test_main
():
test_support
.
run_unittest
(
AllTest
)
run_unittest
(
AllTest
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_main
()
test_main
()
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