[Python-checkins] cpython (3.2): str.format_map tests don't do what they say: fix to actually implement the
eric.smith
python-checkins at python.org
Mon Mar 12 23:29:18 CET 2012
http://hg.python.org/cpython/rev/995cddd15313
changeset: 75558:995cddd15313
branch: 3.2
parent: 75532:3f15c069454d
user: Eric V. Smith <eric at trueblade.com>
date: Mon Mar 12 15:16:22 2012 -0700
summary:
str.format_map tests don't do what they say: fix to actually implement the intent of the test. Closes #13450.
files:
Lib/test/test_unicode.py | 15 +++++++++------
Misc/ACKS | 1 +
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -891,12 +891,15 @@
self.assertEqual('{foo._x}'.format_map({'foo': C(20)}), '20')
# test various errors
- 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)
+ self.assertRaises(TypeError, ''.format_map)
+ self.assertRaises(TypeError, 'a'.format_map)
+
+ self.assertRaises(ValueError, '{'.format_map, {})
+ self.assertRaises(ValueError, '}'.format_map, {})
+ self.assertRaises(ValueError, 'a{'.format_map, {})
+ self.assertRaises(ValueError, 'a}'.format_map, {})
+ self.assertRaises(ValueError, '{a'.format_map, {})
+ self.assertRaises(ValueError, '}a'.format_map, {})
# issue #12579: can't supply positional params to format_map
self.assertRaises(ValueError, '{}'.format_map, {'a' : 2})
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -552,6 +552,7 @@
Christopher Tur Lesniewski-Laas
Mark Levinson
William Lewis
+Akira Li
Xuanji Li
Robert van Liere
Ross Light
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list