[Python-checkins] cpython (2.7): Idlelib & buildbots: suppress py3 deprecation message even if enabled.

terry.reedy python-checkins at python.org
Wed Jan 29 20:42:53 CET 2014


http://hg.python.org/cpython/rev/09716a4d6c52
changeset:   88817:09716a4d6c52
branch:      2.7
parent:      88808:3971e1b07af4
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Wed Jan 29 14:42:32 2014 -0500
summary:
  Idlelib & buildbots: suppress py3 deprecation message even if enabled.

files:
  Lib/idlelib/idle_test/test_calltips.py |  8 ++++++--
  1 files changed, 6 insertions(+), 2 deletions(-)


diff --git a/Lib/idlelib/idle_test/test_calltips.py b/Lib/idlelib/idle_test/test_calltips.py
--- a/Lib/idlelib/idle_test/test_calltips.py
+++ b/Lib/idlelib/idle_test/test_calltips.py
@@ -3,6 +3,7 @@
 CTi = ct.CallTips()  # needed for get_entity test in 2.7
 import textwrap
 import types
+import warnings
 
 default_tip = ''
 
@@ -162,8 +163,11 @@
 
 class Py2Test(unittest.TestCase):
     def test_paramtuple_float(self):
-        # 18539: (a,b) becomes '.0' in code object; change that but not float
-        def f((a,b), c=0.0): pass
+        # 18539: (a,b) becomes '.0' in code object; change that but not 0.0
+        with warnings.catch_warnings():
+            # Suppess message of py3 deprecation of parameter unpacking
+            warnings.simplefilter("ignore")
+            def f((a,b), c=0.0): pass
         self.assertEqual(signature(f), '(<tuple>, c=0.0)')
 
 if __name__ == '__main__':

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list