Author: Matti Picus <[email protected]>
Branch: buffer-interface2
Changeset: r87604:4fa1602ac181
Date: 2016-10-05 22:41 +0300
http://bitbucket.org/pypy/pypy/changeset/4fa1602ac181/

Log:    reset warnings filter after test

diff --git a/pypy/module/cpyext/test/test_memoryobject.py 
b/pypy/module/cpyext/test/test_memoryobject.py
--- a/pypy/module/cpyext/test/test_memoryobject.py
+++ b/pypy/module/cpyext/test/test_memoryobject.py
@@ -47,8 +47,6 @@
 
     @pytest.mark.skipif(only_pypy, reason='pypy only test')
     def test_buffer_info(self):
-        import warnings
-        warnings.filterwarnings("error")
         try:
             from _numpypy import multiarray as np
         except ImportError:
@@ -76,10 +74,15 @@
              )
         x = np.arange(dt1.itemsize, dtype='int8').view(dt1)
         # pytest can catch warnings from v2.8 and up, we ship 2.5
+        import warnings
+        warnings.filterwarnings("error")
         try:
-            y = get_buffer_info(x, ['SIMPLE'])
-        except UserWarning as e:
-            pass
-        else:
-            assert False ,"PyPy-specific UserWarning not raised" \
+            try:
+                y = get_buffer_info(x, ['SIMPLE'])
+            except UserWarning as e:
+                pass
+            else:
+                assert False ,"PyPy-specific UserWarning not raised" \
                           " on too long format string"
+        finally:
+            warnings.resetwarnings()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to