summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-23 12:27:17 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-23 12:27:17 (GMT)
commit2cd8ce469021e851f4ab70106d696136ecddcd51 (patch)
treea746c3a249d77510a6aa033d2797106e9fd92d72 /Lib/test/test_unicode.py
parentbf8f2f9528188ab370aea8698a9951ab0d14ea97 (diff)
downloadcpython-2cd8ce469021e851f4ab70106d696136ecddcd51.zip
cpython-2cd8ce469021e851f4ab70106d696136ecddcd51.tar.gz
cpython-2cd8ce469021e851f4ab70106d696136ecddcd51.tar.bz2
Issue #9856: Replace deprecation warinigs to raising TypeError in object.__format__
Patch by Florent Xicluna.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 6ac62fb..058c83a 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -842,11 +842,9 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual('{0:d}'.format(G('data')), 'G(data)')
self.assertEqual('{0!s}'.format(G('data')), 'string is data')
- msg = 'object.__format__ with a non-empty format string is deprecated'
- with support.check_warnings((msg, DeprecationWarning)):
- self.assertEqual('{0:^10}'.format(E('data')), ' E(data) ')
- self.assertEqual('{0:^10s}'.format(E('data')), ' E(data) ')
- self.assertEqual('{0:>15s}'.format(G('data')), ' string is data')
+ self.assertRaises(TypeError, '{0:^10}'.format, E('data'))
+ self.assertRaises(TypeError, '{0:^10s}'.format, E('data'))
+ self.assertRaises(TypeError, '{0:>15s}'.format, G('data'))
self.assertEqual("{0:date: %Y-%m-%d}".format(I(year=2007,
month=8,