Skip to content

Commit ce07de9

Browse files
authored
[3.11] GH-93481: Suppress expected deprecation warning in test_pyclbr (GH-93483) (GH-93601)
(cherry picked from commit f8eae6f) Co-authored-by: Irit Katriel <[email protected]>
1 parent 68aae80 commit ce07de9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Lib/test/test_pyclbr.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pyclbr
1010
from unittest import TestCase, main as unittest_main
1111
from test.test_importlib import util as test_importlib_util
12+
import warnings
1213

1314

1415
StaticMethodType = type(staticmethod(lambda: None))
@@ -218,9 +219,13 @@ def test_others(self):
218219

219220
# These were once some of the longest modules.
220221
cm('random', ignore=('Random',)) # from _random import Random as CoreGenerator
221-
cm('cgi', ignore=('log',)) # set with = in module
222+
with warnings.catch_warnings():
223+
warnings.simplefilter('ignore', DeprecationWarning)
224+
cm('cgi', ignore=('log',)) # set with = in module
222225
cm('pickle', ignore=('partial', 'PickleBuffer'))
223-
cm('sre_parse', ignore=('dump', 'groups', 'pos')) # from sre_constants import *; property
226+
with warnings.catch_warnings():
227+
warnings.simplefilter('ignore', DeprecationWarning)
228+
cm('sre_parse', ignore=('dump', 'groups', 'pos')) # from sre_constants import *; property
224229
cm(
225230
'pdb',
226231
# pyclbr does not handle elegantly `typing` or properties

0 commit comments

Comments
 (0)