From edbb6ca084b4446dcf6c78c942e875a3b16a4397 Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Mon, 12 Mar 2012 15:16:22 -0700 Subject: [PATCH] str.format_map tests don't do what they say: fix to actually implement the intent of the test. Closes #13450. --- 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 index 259a181b3bd..19b06a034d6 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -891,12 +891,15 @@ class UnicodeTest(string_tests.CommonTest, 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 index 00288772b24..e7bc2b6c8bf 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -552,6 +552,7 @@ John Lenton Christopher Tur Lesniewski-Laas Mark Levinson William Lewis +Akira Li Xuanji Li Robert van Liere Ross Light