@@ -1310,11 +1310,12 @@ def test_clear_and_catch_warnings():
1310
1310
warnings .simplefilter ('ignore' )
1311
1311
warnings .warn ('Another warning' )
1312
1312
assert_warn_len_equal (my_mod , 2 )
1313
- # Another warning, no module spec does add to warnings dict
1313
+
1314
+ # Another warning, no module spec it clears up registry
1314
1315
with clear_and_catch_warnings ():
1315
1316
warnings .simplefilter ('ignore' )
1316
1317
warnings .warn ('Another warning' )
1317
- assert_warn_len_equal (my_mod , 2 )
1318
+ assert_warn_len_equal (my_mod , 0 )
1318
1319
1319
1320
1320
1321
def test_suppress_warnings_module ():
@@ -1356,15 +1357,11 @@ def warn(arr):
1356
1357
warnings .warn ('Some warning' )
1357
1358
assert_warn_len_equal (my_mod , 0 )
1358
1359
1359
- # Manually adding two warnings to the registry:
1360
- my_mod .__warningregistry__ = {'warning1' : 1 ,
1361
- 'warning2' : 2 }
1362
-
1363
- # Without specified modules, don't clear warnings during context
1360
+ # Without specified modules
1364
1361
with suppress_warnings ():
1365
1362
warnings .simplefilter ('ignore' )
1366
1363
warnings .warn ('Some warning' )
1367
- assert_warn_len_equal (my_mod , 2 )
1364
+ assert_warn_len_equal (my_mod , 0 )
1368
1365
1369
1366
1370
1367
def test_suppress_warnings_type ():
@@ -1388,15 +1385,11 @@ def test_suppress_warnings_type():
1388
1385
warnings .warn ('Some warning' )
1389
1386
assert_warn_len_equal (my_mod , 0 )
1390
1387
1391
- # Manually adding two warnings to the registry:
1392
- my_mod .__warningregistry__ = {'warning1' : 1 ,
1393
- 'warning2' : 2 }
1394
-
1395
- # Without specified modules, don't clear warnings during context
1388
+ # Without specified modules
1396
1389
with suppress_warnings ():
1397
1390
warnings .simplefilter ('ignore' )
1398
1391
warnings .warn ('Some warning' )
1399
- assert_warn_len_equal (my_mod , 2 )
1392
+ assert_warn_len_equal (my_mod , 0 )
1400
1393
1401
1394
1402
1395
def test_suppress_warnings_decorate_no_record ():
0 commit comments