File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -474,6 +474,11 @@ def foo(bar=baz, bax):
474
474
pass
475
475
"""
476
476
with self .makeTempFile (source ) as sourcePath :
477
+ if sys .version_info >= (3 , 12 ):
478
+ msg = 'parameter without a default follows parameter with a default' # noqa: E501
479
+ else :
480
+ msg = 'non-default argument follows default argument'
481
+
477
482
if PYPY and sys .version_info >= (3 , 9 ):
478
483
column = 18
479
484
elif PYPY :
@@ -485,13 +490,13 @@ def foo(bar=baz, bax):
485
490
else :
486
491
column = 9
487
492
last_line = ' ' * (column - 1 ) + '^\n '
488
- columnstr = '%d:' % column
489
493
self .assertHasErrors (
490
494
sourcePath ,
491
- ["""\
492
- {}:1:{} non-default argument follows default argument
495
+ [f """\
496
+ { sourcePath } :1:{ column } : { msg }
493
497
def foo(bar=baz, bax):
494
- {}""" .format (sourcePath , columnstr , last_line )])
498
+ { last_line } """ ]
499
+ )
495
500
496
501
def test_nonKeywordAfterKeywordSyntaxError (self ):
497
502
"""
@@ -532,7 +537,7 @@ def test_invalidEscape(self):
532
537
column = 7
533
538
elif PYPY :
534
539
column = 6
535
- elif sys .version_info >= (3 , 9 ):
540
+ elif ( 3 , 9 ) <= sys .version_info < (3 , 12 ):
536
541
column = 13
537
542
else :
538
543
column = 7
You can’t perform that action at this time.
0 commit comments