We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 859992a commit 34df94dCopy full SHA for 34df94d
sklearn/utils/tests/test_testing.py
@@ -85,13 +85,17 @@ def _raise_ValueError(message):
85
86
87
# This class is inspired from numpy 1.7 with an alteration to check
88
-# the emptied warning filters after calls to assert_warns.
+# the reset warning filters after calls to assert_warns.
89
+# This assert_warns behavior is specific to scikit-learn.
90
class TestWarns(unittest.TestCase):
91
def test_warn(self):
92
def f():
93
warnings.warn("yo")
94
return 3
95
96
+ # Test that assert_warns is not impacted by externally set
97
+ # filters and is reset internally.
98
+ warnings.simplefilter("ignore", UserWarning)
99
assert_equal(assert_warns(UserWarning, f), 3)
100
101
# Test that the warning registry is empty after assert_warns
0 commit comments