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):
474474 pass
475475"""
476476 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+
477482 if PYPY and sys .version_info >= (3 , 9 ):
478483 column = 18
479484 elif PYPY :
@@ -485,13 +490,13 @@ def foo(bar=baz, bax):
485490 else :
486491 column = 9
487492 last_line = ' ' * (column - 1 ) + '^\n '
488- columnstr = '%d:' % column
489493 self .assertHasErrors (
490494 sourcePath ,
491- ["""\
492- {}:1:{} non-default argument follows default argument
495+ [f """\
496+ { sourcePath } :1:{ column } : { msg }
493497def foo(bar=baz, bax):
494- {}""" .format (sourcePath , columnstr , last_line )])
498+ { last_line } """ ]
499+ )
495500
496501 def test_nonKeywordAfterKeywordSyntaxError (self ):
497502 """
@@ -532,7 +537,7 @@ def test_invalidEscape(self):
532537 column = 7
533538 elif PYPY :
534539 column = 6
535- elif sys .version_info >= (3 , 9 ):
540+ elif ( 3 , 9 ) <= sys .version_info < (3 , 12 ):
536541 column = 13
537542 else :
538543 column = 7
You can’t perform that action at this time.
0 commit comments