@@ -1223,7 +1223,7 @@ def test_regex(self):
12231223 lambda : assert_string_equal ("aaa" , "a+b" ))
12241224
12251225
1226- def assert_warn_len_equal (mod , n_in_context , py37 = None ):
1226+ def assert_warn_len_equal (mod , n_in_context ):
12271227 try :
12281228 mod_warns = mod .__warningregistry__
12291229 except AttributeError :
@@ -1245,6 +1245,7 @@ def assert_warn_len_equal(mod, n_in_context, py37=None):
12451245
12461246 assert_equal (num_warns , n_in_context )
12471247
1248+
12481249def test_warn_len_equal_call_scenarios ():
12491250 # assert_warn_len_equal is called under
12501251 # varying circumstances depending on serial
@@ -1294,22 +1295,20 @@ def test_clear_and_catch_warnings():
12941295 warnings .warn ('Some warning' )
12951296 assert_equal (my_mod .__warningregistry__ , {})
12961297 # Without specified modules, don't clear warnings during context
1297- # Python 3.7 catch_warnings doesn't make an entry for 'ignore'.
12981298 with clear_and_catch_warnings ():
12991299 warnings .simplefilter ('ignore' )
13001300 warnings .warn ('Some warning' )
1301- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1301+ assert_warn_len_equal (my_mod , 1 )
13021302 # Confirm that specifying module keeps old warning, does not add new
13031303 with clear_and_catch_warnings (modules = [my_mod ]):
13041304 warnings .simplefilter ('ignore' )
13051305 warnings .warn ('Another warning' )
1306- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1306+ assert_warn_len_equal (my_mod , 1 )
13071307 # Another warning, no module spec does add to warnings dict, except on
1308- # Python 3.7 catch_warnings doesn't make an entry for 'ignore'.
13091308 with clear_and_catch_warnings ():
13101309 warnings .simplefilter ('ignore' )
13111310 warnings .warn ('Another warning' )
1312- assert_warn_len_equal (my_mod , 2 , py37 = 0 )
1311+ assert_warn_len_equal (my_mod , 2 )
13131312
13141313
13151314def test_suppress_warnings_module ():
@@ -1338,7 +1337,7 @@ def warn(arr):
13381337 # got filtered)
13391338 assert_equal (len (sup .log ), 1 )
13401339 assert_equal (sup .log [0 ].message .args [0 ], "Some warning" )
1341- assert_warn_len_equal (my_mod , 0 , py37 = 0 )
1340+ assert_warn_len_equal (my_mod , 0 )
13421341 sup = suppress_warnings ()
13431342 # Will have to be changed if apply_along_axis is moved:
13441343 sup .filter (module = my_mod )
@@ -1352,11 +1351,11 @@ def warn(arr):
13521351 assert_warn_len_equal (my_mod , 0 )
13531352
13541353 # Without specified modules, don't clear warnings during context
1355- # Python 3.7 does not add ignored warnings.
13561354 with suppress_warnings ():
13571355 warnings .simplefilter ('ignore' )
13581356 warnings .warn ('Some warning' )
1359- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1357+ assert_warn_len_equal (my_mod , 1 )
1358+
13601359
13611360def test_suppress_warnings_type ():
13621361 # Initial state of module, no warnings
@@ -1380,11 +1379,10 @@ def test_suppress_warnings_type():
13801379 assert_warn_len_equal (my_mod , 0 )
13811380
13821381 # Without specified modules, don't clear warnings during context
1383- # Python 3.7 does not add ignored warnings.
13841382 with suppress_warnings ():
13851383 warnings .simplefilter ('ignore' )
13861384 warnings .warn ('Some warning' )
1387- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1385+ assert_warn_len_equal (my_mod , 1 )
13881386
13891387
13901388def test_suppress_warnings_decorate_no_record ():
0 commit comments