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
14ad5319
Commit
14ad5319
authored
Aug 22, 2014
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22191: Fix warnings.__all__.
Thanks to Jon Poler for the patch.
parent
a969ae2e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
Lib/test/test_warnings.py
Lib/test/test_warnings.py
+19
-0
Lib/warnings.py
Lib/warnings.py
+2
-1
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_warnings.py
View file @
14ad5319
...
...
@@ -61,6 +61,25 @@ class BaseTest:
sys
.
modules
[
'warnings'
]
=
original_warnings
super
(
BaseTest
,
self
).
tearDown
()
class
PublicAPITests
(
BaseTest
):
"""Ensures that the correct values are exposed in the
public API.
"""
def
test_module_all_attribute
(
self
):
self
.
assertTrue
(
hasattr
(
self
.
module
,
'__all__'
))
target_api
=
[
"warn"
,
"warn_explicit"
,
"showwarning"
,
"formatwarning"
,
"filterwarnings"
,
"simplefilter"
,
"resetwarnings"
,
"catch_warnings"
]
self
.
assertSetEqual
(
set
(
self
.
module
.
__all__
),
set
(
target_api
))
class
CPublicAPITests
(
PublicAPITests
,
unittest
.
TestCase
):
module
=
c_warnings
class
PyPublicAPITests
(
PublicAPITests
,
unittest
.
TestCase
):
module
=
py_warnings
class
FilterTests
(
BaseTest
):
...
...
Lib/warnings.py
View file @
14ad5319
...
...
@@ -2,7 +2,8 @@
import
sys
__all__
=
[
"warn"
,
"showwarning"
,
"formatwarning"
,
"filterwarnings"
,
__all__
=
[
"warn"
,
"warn_explicit"
,
"showwarning"
,
"formatwarning"
,
"filterwarnings"
,
"simplefilter"
,
"resetwarnings"
,
"catch_warnings"
]
...
...
Misc/ACKS
View file @
14ad5319
...
...
@@ -1054,6 +1054,7 @@ Antoine Pitrou
Jean-François Piéronne
Oleg Plakhotnyuk
Remi Pointel
Jon Poler
Ariel Poliak
Guilherme Polo
Illia Polosukhin
...
...
Misc/NEWS
View file @
14ad5319
...
...
@@ -27,6 +27,8 @@ Core and Builtins
Library
-------
-- Issue #22191: Fix warnings.__all__.
- Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
- Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
...
...
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