Commits

Philip Jenvey committed a5aff3a

default ResourceWarning to ignore

Comments (0)

Files changed (2)

pypy/module/_warnings/interp_warnings.py

         filters_w.append(create_filter(
             space, space.w_BytesWarning, action))
 
+        filters_w.append(create_filter(
+            space, space.w_ResourceWarning, "ignore"))
+
         self.w_filters = space.newlist(filters_w)
 
 def get_warnings_attr(space, name):

pypy/module/_warnings/test/test_warnings.py

         import _warnings
         assert _warnings._onceregistry == {}
         assert _warnings._defaultaction == 'default'
-        assert "PendingDeprecationWarning" in str(_warnings.filters)
+        expected = [('ignore', None, DeprecationWarning, None, 0),
+                    ('ignore', None, PendingDeprecationWarning, None, 0),
+                    ('ignore', None, ImportWarning, None, 0),
+                    ('ignore', None, BytesWarning, None, 0),
+                    ('ignore', None, ResourceWarning, None, 0)]
+        assert expected == _warnings.filters
 
     def test_warn(self):
         import _warnings