diff options
author | Benjamin Peterson <benjamin@python.org> | 2018-10-02 04:54:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 04:54:39 (GMT) |
commit | cbda8fc5d76b10bcbb92d927537576c229143836 (patch) | |
tree | a7e6b25e8c95fd72a78e11773dd6994b157013b9 /Lib/test/test_long.py | |
parent | 30534cc7172f36092e0002bb7df482edc0d539ce (diff) | |
download | cpython-cbda8fc5d76b10bcbb92d927537576c229143836.zip cpython-cbda8fc5d76b10bcbb92d927537576c229143836.tar.gz cpython-cbda8fc5d76b10bcbb92d927537576c229143836.tar.bz2 |
closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666)
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r-- | Lib/test/test_long.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 7c883ba..5b860dd 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -700,6 +700,9 @@ class LongTest(unittest.TestCase): self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, '_,d') self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, ',_d') + self.assertRaisesRegex(ValueError, "Cannot specify ',' with 's'", format, 3, ',s') + self.assertRaisesRegex(ValueError, "Cannot specify '_' with 's'", format, 3, '_s') + # ensure that only int and float type specifiers work for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] + [chr(x) for x in range(ord('A'), ord('Z')+1)]): |