[Python-checkins] cpython (2.7): #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:09 CET 2011


http://hg.python.org/cpython/rev/a8deeb549e1a
changeset: 73881:a8deeb549e1a
branch: 2.7
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Thu Dec 08 00:00:49 2011 +0200
summary:
 #13531: add a test for defaultdict with a non-callable arg. Patch by Mike Cheng.
files:
 Lib/test/test_defaultdict.py | 2 ++
 1 files changed, 2 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
@@ -171,6 +171,8 @@
 finally:
 os.remove(tfn)
 
+ def test_callable_arg(self):
+ self.assertRaises(TypeError, defaultdict, {})
 
 def test_main():
 test_support.run_unittest(TestDefaultDict)
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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