@@ -64,7 +64,7 @@ def test_assert_allclose_safely():
64
64
65
65
def assert_warn_len_equal (mod , n_in_context ):
66
66
mod_warns = mod .__warningregistry__
67
- # Python 3.4 appears to clear any pre-existing warnings of the same type,
67
+ # Python 3 appears to clear any pre-existing warnings of the same type,
68
68
# when raising warnings inside a catch_warnings block. So, there is a
69
69
# warning generated by the tests within the context manager, but no
70
70
# previous warnings.
@@ -84,18 +84,15 @@ def test_clear_and_catch_warnings():
84
84
assert_equal (my_mod .__warningregistry__ , {})
85
85
# Without specified modules, don't clear warnings during context
86
86
with clear_and_catch_warnings ():
87
- warnings .simplefilter ('ignore' )
88
87
warnings .warn ('Some warning' )
89
88
assert_warn_len_equal (my_mod , 1 )
90
89
# Confirm that specifying module keeps old warning, does not add new
91
90
with clear_and_catch_warnings (modules = [my_mod ]):
92
- warnings .simplefilter ('ignore' )
93
91
warnings .warn ('Another warning' )
94
92
assert_warn_len_equal (my_mod , 1 )
95
93
# Another warning, no module spec does add to warnings dict, except on
96
- # Python 3.4 (see comments in `assert_warn_len_equal`)
94
+ # Python 3 (see comments in `assert_warn_len_equal`)
97
95
with clear_and_catch_warnings ():
98
- warnings .simplefilter ('ignore' )
99
96
warnings .warn ('Another warning' )
100
97
assert_warn_len_equal (my_mod , 2 )
101
98
0 commit comments