mirror of
https://github.com/python/cpython
synced 2026-09-29 11:30:29 +03:00
Merge for issue #22191 fix
This commit is contained in:
commit
145759c892
3 changed files with 22 additions and 1 deletions
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
import sys
|
||||
|
||||
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
|
||||
__all__ = ["warn", "warn_explicit", "showwarning",
|
||||
"formatwarning", "filterwarnings", "simplefilter",
|
||||
"resetwarnings", "catch_warnings"]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1063,6 +1063,7 @@ Antoine Pitrou
|
|||
Jean-François Piéronne
|
||||
Oleg Plakhotnyuk
|
||||
Remi Pointel
|
||||
Jon Poler
|
||||
Ariel Poliak
|
||||
Guilherme Polo
|
||||
Illia Polosukhin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue