New submission from akira <4kir4...@gmail.com>:

It seems that some assertions in 
Lib/test/test_unicode.py:UnicodeTest.test_format_map do not implement their 
intent e.g.,

        self.assertRaises(TypeError, '{'.format_map)
        self.assertRaises(TypeError, '}'.format_map)
        self.assertRaises(TypeError, 'a{'.format_map)
        self.assertRaises(TypeError, 'a}'.format_map)
        self.assertRaises(TypeError, '{a'.format_map)
        self.assertRaises(TypeError, '}a'.format_map)

The intent might be to test:

  >>> '{'.format_map({})
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  ValueError: Single '{' encountered in format string

But it actually tests:

  >>> '{'.format_map()
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: format_map() takes exactly one argument (0 given)

Provided correct-assertions-in-test_format_map.patch contains additional 
assertions e.g.,

      self.assertRaises(ValueError, '{'.format_map, {})

Old assertions might be useful so they're left untouched.

----------
components: Tests
files: correct-assertions-in-test_format_map.patch
keywords: patch
messages: 148096
nosy: akira
priority: normal
severity: normal
status: open
title: fix ''.format_map test
versions: Python 3.2, Python 3.3, Python 3.4
Added file: 
http://bugs.python.org/file23747/correct-assertions-in-test_format_map.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13450>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to