From 68cb7dfc1b752429fbd70555ff53ada5d428c152 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Fri, 3 Jun 2022 22:54:37 +0100 Subject: [PATCH] GH-93481: Suppress expected deprecation warning in test_pyclbr --- Lib/test/test_pyclbr.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index ad7b31aef1ddd1..b2de4e8397d6ad 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -9,6 +9,7 @@ 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,9 +219,13 @@ def test_others(self): # These were once some of the longest modules. cm('random', ignore=('Random',)) # from _random import Random as CoreGenerator - cm('cgi', ignore=('log',)) # set with = in module + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + cm('cgi', ignore=('log',)) # set with = in module cm('pickle', ignore=('partial', 'PickleBuffer')) - cm('sre_parse', ignore=('dump', 'groups', 'pos')) # from sre_constants import *; property + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + cm('sre_parse', ignore=('dump', 'groups', 'pos')) # from sre_constants import *; property cm( 'pdb', # pyclbr does not handle elegantly `typing` or properties