Skip to content

Commit 30665c0

Browse files
Merge pull request #1 from VallinZ/unitTest
Unit test (unhappy and happy path) for str.format() with specifiers '<, >, ^'
2 parents c5d0b71 + 31542a1 commit 30665c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test-data/unit/check-formatting.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ b'%c' % (123)
265265
-- ------------------
266266

267267

268+
[case testFormatCallNoneAlignment]
269+
'{:<1}'.format(None) # E: Alignment format specifier "<" is not supported for None
270+
'{:>1}'.format(None) # E: Alignment format specifier ">" is not supported for None
271+
'{:^1}'.format(None) # E: Alignment format specifier "^" is not supported for None
272+
273+
'{:<10}'.format('16') # OK
274+
'{:>10}'.format('16') # OK
275+
'{:^10}'.format('16') # OK
276+
[builtins fixtures/primitives.pyi]
277+
268278
[case testFormatCallParseErrors]
269279
'}'.format() # E: Invalid conversion specifier in format string: unexpected }
270280
'{'.format() # E: Invalid conversion specifier in format string: unmatched {

0 commit comments

Comments
 (0)