diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2024-05-28 09:01:37 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-28 09:01:37 (GMT) |
| commit | b313cc68d50de5fb5f43acffd402c5c4da6516fc (patch) | |
| tree | 3d25305bb921d8e3748db524ec9267e65ecb242f /Lib/test/test_str.py | |
| parent | bf08f0a5fe5750904aa4a239945db16d2c43f6e7 (diff) | |
| download | cpython-b313cc68d50de5fb5f43acffd402c5c4da6516fc.zip cpython-b313cc68d50de5fb5f43acffd402c5c4da6516fc.tar.gz cpython-b313cc68d50de5fb5f43acffd402c5c4da6516fc.tar.bz2 | |
gh-117557: Improve error messages when a string, bytes or bytearray of length 1 are expected (GH-117631)
Diffstat (limited to 'Lib/test/test_str.py')
| -rw-r--r-- | Lib/test/test_str.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py index ea37eb5..7bdd288 100644 --- a/Lib/test/test_str.py +++ b/Lib/test/test_str.py @@ -1578,7 +1578,7 @@ class StrTest(string_tests.StringLikeTest, self.assertRaisesRegex(TypeError, '%u format: a real number is required, not complex', operator.mod, '%u', 3j) self.assertRaisesRegex(TypeError, '%i format: a real number is required, not complex', operator.mod, '%i', 2j) self.assertRaisesRegex(TypeError, '%d format: a real number is required, not complex', operator.mod, '%d', 1j) - self.assertRaisesRegex(TypeError, '%c requires int or char', operator.mod, '%c', pi) + self.assertRaisesRegex(TypeError, r'%c requires an int or a unicode character, not .*\.PseudoFloat', operator.mod, '%c', pi) class RaisingNumber: def __int__(self): |
