@@ -1223,7 +1223,7 @@ def test_regex(self):
1223
1223
lambda : assert_string_equal ("aaa" , "a+b" ))
1224
1224
1225
1225
1226
- def assert_warn_len_equal (mod , n_in_context , py37 = None ):
1226
+ def assert_warn_len_equal (mod , n_in_context ):
1227
1227
try :
1228
1228
mod_warns = mod .__warningregistry__
1229
1229
except AttributeError :
@@ -1245,6 +1245,7 @@ def assert_warn_len_equal(mod, n_in_context, py37=None):
1245
1245
1246
1246
assert_equal (num_warns , n_in_context )
1247
1247
1248
+
1248
1249
def test_warn_len_equal_call_scenarios ():
1249
1250
# assert_warn_len_equal is called under
1250
1251
# varying circumstances depending on serial
@@ -1294,22 +1295,20 @@ def test_clear_and_catch_warnings():
1294
1295
warnings .warn ('Some warning' )
1295
1296
assert_equal (my_mod .__warningregistry__ , {})
1296
1297
# Without specified modules, don't clear warnings during context
1297
- # Python 3.7 catch_warnings doesn't make an entry for 'ignore'.
1298
1298
with clear_and_catch_warnings ():
1299
1299
warnings .simplefilter ('ignore' )
1300
1300
warnings .warn ('Some warning' )
1301
- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1301
+ assert_warn_len_equal (my_mod , 1 )
1302
1302
# Confirm that specifying module keeps old warning, does not add new
1303
1303
with clear_and_catch_warnings (modules = [my_mod ]):
1304
1304
warnings .simplefilter ('ignore' )
1305
1305
warnings .warn ('Another warning' )
1306
- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1306
+ assert_warn_len_equal (my_mod , 1 )
1307
1307
# 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'.
1309
1308
with clear_and_catch_warnings ():
1310
1309
warnings .simplefilter ('ignore' )
1311
1310
warnings .warn ('Another warning' )
1312
- assert_warn_len_equal (my_mod , 2 , py37 = 0 )
1311
+ assert_warn_len_equal (my_mod , 2 )
1313
1312
1314
1313
1315
1314
def test_suppress_warnings_module ():
@@ -1338,7 +1337,7 @@ def warn(arr):
1338
1337
# got filtered)
1339
1338
assert_equal (len (sup .log ), 1 )
1340
1339
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 )
1342
1341
sup = suppress_warnings ()
1343
1342
# Will have to be changed if apply_along_axis is moved:
1344
1343
sup .filter (module = my_mod )
@@ -1352,11 +1351,11 @@ def warn(arr):
1352
1351
assert_warn_len_equal (my_mod , 0 )
1353
1352
1354
1353
# Without specified modules, don't clear warnings during context
1355
- # Python 3.7 does not add ignored warnings.
1356
1354
with suppress_warnings ():
1357
1355
warnings .simplefilter ('ignore' )
1358
1356
warnings .warn ('Some warning' )
1359
- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1357
+ assert_warn_len_equal (my_mod , 1 )
1358
+
1360
1359
1361
1360
def test_suppress_warnings_type ():
1362
1361
# Initial state of module, no warnings
@@ -1380,11 +1379,10 @@ def test_suppress_warnings_type():
1380
1379
assert_warn_len_equal (my_mod , 0 )
1381
1380
1382
1381
# Without specified modules, don't clear warnings during context
1383
- # Python 3.7 does not add ignored warnings.
1384
1382
with suppress_warnings ():
1385
1383
warnings .simplefilter ('ignore' )
1386
1384
warnings .warn ('Some warning' )
1387
- assert_warn_len_equal (my_mod , 1 , py37 = 0 )
1385
+ assert_warn_len_equal (my_mod , 1 )
1388
1386
1389
1387
1390
1388
def test_suppress_warnings_decorate_no_record ():
0 commit comments