]> granicus.if.org Git - python/commitdiff
Silence a couple of warnings.
authorEzio Melotti <ezio.melotti@gmail.com>
Sun, 6 Nov 2011 16:50:32 +0000 (18:50 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Sun, 6 Nov 2011 16:50:32 +0000 (18:50 +0200)
Lib/test/pickletester.py
Lib/test/test_cfgparser.py

index 2e3875c57bf2d48484103f5f18d3583e3869a8e7..c321f8e78a593f8dade95d9538fd53e90c375019 100644 (file)
@@ -132,6 +132,8 @@ class pickling_metaclass(type):
     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)
index 4885c8c6499e170138e4ff8a884e4d03aca0495b..a7ad18dc0f645fb3235ff43ab373f4cc5b2f10d8 100644 (file)
@@ -548,8 +548,9 @@ class TestChainMap(unittest.TestCase):
                          [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.