summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r--Lib/test/test_format.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 565bb79..83eb29f 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -278,7 +278,7 @@ class FormatTest(unittest.TestCase):
test_exc('%d', '1', TypeError, "%d format: a number is required, not str")
test_exc('%x', '1', TypeError, "%x format: an integer is required, not str")
test_exc('%x', 3.14, TypeError, "%x format: an integer is required, not float")
- test_exc('%g', '1', TypeError, "a float is required")
+ test_exc('%g', '1', TypeError, "must be real number, not str")
test_exc('no format', '1', TypeError,
"not all arguments converted during string formatting")
test_exc('%c', -1, OverflowError, "%c arg not in range(0x110000)")
@@ -304,6 +304,8 @@ class FormatTest(unittest.TestCase):
testcommon(b"%c", 7, b"\x07")
testcommon(b"%c", b"Z", b"Z")
testcommon(b"%c", bytearray(b"Z"), b"Z")
+ testcommon(b"%5c", 65, b" A")
+ testcommon(b"%-5c", 65, b"A ")
# %b will insert a series of bytes, either from a type that supports
# the Py_buffer protocol, or something that has a __bytes__ method
class FakeBytes(object):