[Python-checkins] cpython (2.7): Silence a couple of warnings.

ezio.melotti python-checkins at python.org
Sun Nov 6 17:51:00 CET 2011


http://hg.python.org/cpython/rev/a6d70861bf6d
changeset:   73406:a6d70861bf6d
branch:      2.7
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sun Nov 06 18:50:32 2011 +0200
summary:
  Silence a couple of warnings.

files:
  Lib/test/pickletester.py   |  2 ++
  Lib/test/test_cfgparser.py |  5 +++--
  2 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -132,6 +132,8 @@
     def __reduce__(self):
         return (create_dynamic_class, self.reduce_args)
 
+    __hash__ = None
+
 def create_dynamic_class(name, bases):
     result = pickling_metaclass(name, bases, dict())
     result.reduce_args = (name, bases)
diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py
--- a/Lib/test/test_cfgparser.py
+++ b/Lib/test/test_cfgparser.py
@@ -548,8 +548,9 @@
                          [dcomb.get(k, 10) for k in klist])      # get()
         self.assertEqual([k in cm for k in klist],
                          [k in dcomb for k in klist])            # __contains__()
-        self.assertEqual([cm.has_key(k) for k in klist],
-                         [dcomb.has_key(k) for k in klist])      # has_key()
+        with test_support.check_py3k_warnings():
+            self.assertEqual([cm.has_key(k) for k in klist],
+                             [dcomb.has_key(k) for k in klist])  # has_key()
 
 class Issue7005TestCase(unittest.TestCase):
     """Test output when None is set() as a value and allow_no_value == False.

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


More information about the Python-checkins mailing list