mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
#6780: fix starts/endswith error message to mention that tuples are accepted too.
This commit is contained in:
parent
2043f9c582
commit
ba42fd5801
6 changed files with 66 additions and 13 deletions
|
@ -789,6 +789,17 @@ class UnicodeTest(
|
|||
self.assertEqual('%f' % INF, 'inf')
|
||||
self.assertEqual('%F' % INF, 'INF')
|
||||
|
||||
def test_startswith_endswith_errors(self):
|
||||
for meth in ('foo'.startswith, 'foo'.endswith):
|
||||
try:
|
||||
meth(['f'])
|
||||
except TypeError as err:
|
||||
exc = str(err)
|
||||
else:
|
||||
self.fail('starts/endswith unexpectedly succeeded')
|
||||
self.assertIn('str', exc)
|
||||
self.assertIn('tuple', exc)
|
||||
|
||||
@support.run_with_locale('LC_ALL', 'de_DE', 'fr_FR')
|
||||
def test_format_float(self):
|
||||
# should not format with a comma, but always with C locale
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue