@@ -657,7 +657,9 @@ def test_attributes(self):
657657 self .assertIsInstance (sys .int_info .str_digits_check_threshold , int )
658658 self .assertIsInstance (sys .hexversion , int )
659659
660- self .assertEqual (len (sys .hash_info ), 9 )
660+ with warnings .catch_warnings (category = DeprecationWarning ):
661+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
662+ self .assertEqual (len (sys .hash_info ), 9 )
661663 self .assertLess (sys .hash_info .modulus , 2 ** sys .hash_info .width )
662664 # sys.hash_info.modulus should be a prime; we do a quick
663665 # probable primality test (doesn't exclude the possibility of
@@ -879,7 +881,9 @@ def test_sys_flags_indexable_attributes(self):
879881 self .assertEqual (sys .flags [attr_idx ], attr_value ,
880882 msg = f"sys.flags .{ attr } vs [{ attr_idx } ]" )
881883 self .assertTrue (repr (sys .flags ))
882- self .assertEqual (len (sys .flags ), 18 , msg = "Do not increase, see GH-122575" )
884+ with warnings .catch_warnings (category = DeprecationWarning ):
885+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
886+ self .assertEqual (len (sys .flags ), 18 , msg = "Do not increase, see GH-122575" )
883887
884888 self .assertIn (sys .flags .utf8_mode , {0 , 1 , 2 })
885889
@@ -1941,7 +1945,9 @@ def test_pythontypes(self):
19411945 # per GH-122575 would be nice...
19421946 # Q: What is the actual point of this sys.flags C size derived from PyStructSequence_Field array assertion?
19431947 non_sequence_fields = 4
1944- check (sys .flags , vsize ('' ) + self .P + self .P * (non_sequence_fields + len (sys .flags )))
1948+ with warnings .catch_warnings (category = DeprecationWarning ):
1949+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
1950+ check (sys .flags , vsize ('' ) + self .P + self .P * (non_sequence_fields + len (sys .flags )))
19451951
19461952 def test_asyncgen_hooks (self ):
19471953 old = sys .get_asyncgen_hooks ()
0 commit comments