[Python-checkins] cpython (3.2): #13531: add a test for defaultdict with a non-callable arg. Patch by Mike

ezio.melotti python-checkins at python.org
Wed Dec 7 23:04:10 CET 2011


http://hg.python.org/cpython/rev/17ceebc61b65
changeset:   73882:17ceebc61b65
branch:      3.2
parent:      73877:3822c8087d70
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Thu Dec 08 00:02:00 2011 +0200
summary:
  #13531: add a test for defaultdict with a non-callable arg.  Patch by Mike Cheng.

files:
  Lib/test/test_defaultdict.py |  3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py
--- a/Lib/test/test_defaultdict.py
+++ b/Lib/test/test_defaultdict.py
@@ -172,6 +172,9 @@
         finally:
             os.remove(tfn)
 
+    def test_callable_arg(self):
+        self.assertRaises(TypeError, defaultdict, {})
+
     def test_pickleing(self):
         d = defaultdict(int)
         d[1]

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


More information about the Python-checkins mailing list