[issue13531] add test for defaultdict with non-callable first argument

2011-12-05 Thread mike c

New submission from mike c :

Could a test be added to ./Lib/test/test_defaultdict.py to test for TypeError 
being thrown when the the first argument to collections.defaultdict is not 
callable?  

pypy does not behave the same way as CPython 2.7.2 as the problem is not 
covered in the testcases.

e.g.
def test_callable_arg:
d1 = defaultdict({})
self.assertRaises(TypeError)  # TypeError: first argument must be callable

--
components: Tests
messages: 148868
nosy: mike.c
priority: normal
severity: normal
status: open
title: add test for defaultdict with non-callable first argument
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue13531>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13531] add test for defaultdict with non-callable first argument

2011-12-05 Thread mike c

mike c  added the comment:

Cloning repo. Reading the devguide.  Patch forthcoming.

--

___
Python tracker 
<http://bugs.python.org/issue13531>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13531] add test for defaultdict with non-callable first argument

2011-12-05 Thread mike c

mike c  added the comment:

Patch to add a defaultdict test which checks that if the first argument is not 
callable, then a TypeError is thrown.

--
keywords: +patch
Added file: http://bugs.python.org/file23855/defaultdict_callable_test.patch

___
Python tracker 
<http://bugs.python.org/issue13531>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13531] add test for defaultdict with non-callable first argument

2011-12-05 Thread mike c

mike c  added the comment:

patch v2. Now with assertRaises()!

--
Added file: http://bugs.python.org/file23856/defaultdict_callable_test_v2.patch

___
Python tracker 
<http://bugs.python.org/issue13531>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com