diff options
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 4793707..772ea35 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -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 |