[3.11] GH-93481: Suppress expected deprecation warning in test_pyclbr (GH-93483) (GH-93601)

(cherry picked from commit f8eae6f5c3)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Irit Katriel 2022-06-08 16:16:46 +01:00 committed by GitHub
parent 68aae80159
commit ce07de9059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -9,6 +9,7 @@ from types import FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase, main as unittest_main
from test.test_importlib import util as test_importlib_util
import warnings
StaticMethodType = type(staticmethod(lambda: None))
@ -218,8 +219,12 @@ class PyclbrTest(TestCase):
# These were once some of the longest modules.
cm('random', ignore=('Random',)) # from _random import Random as CoreGenerator
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
cm('cgi', ignore=('log',)) # set with = in module
cm('pickle', ignore=('partial', 'PickleBuffer'))
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
cm('sre_parse', ignore=('dump', 'groups', 'pos')) # from sre_constants import *; property
cm(
'pdb',