[Python-checkins] cpython (2.7): test_array: make quiet the DeprecationWarning

victor.stinner python-checkins at python.org
Tue Jul 5 13:37:45 CEST 2011


http://hg.python.org/cpython/rev/7bfedb159e82
changeset: 71226:7bfedb159e82
branch: 2.7
parent: 71223:6abbc5f68e20
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Tue Jul 05 13:14:17 2011 +0200
summary:
 test_array: make quiet the DeprecationWarning
files:
 Lib/test/test_array.py | 5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -4,6 +4,7 @@
 """
 
 import unittest
+import warnings
 from test import test_support
 from weakref import proxy
 import array, cStringIO
@@ -783,7 +784,9 @@
 
 def test_subclass_with_kwargs(self):
 # SF bug #1486663 -- this used to erroneously raise a TypeError
- ArraySubclassWithKwargs('b', newarg=1)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", '', DeprecationWarning)
+ ArraySubclassWithKwargs('b', newarg=1)
 
 
 class StringTest(BaseTest):
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /