@@ -466,8 +466,8 @@ def test_type_ignore(self):
466466 ):
467467 self .check_ast_roundtrip (statement , type_comments = True )
468468
469- def test_unparse_interactive (self ):
470- # gh-129598: Fix of ast.unparse() when ast.Interactive contains multiple statements
469+ def test_unparse_interactive_semicolons (self ):
470+ # gh-129598: Fix ast.unparse() when ast.Interactive contains multiple statements
471471 self .check_src_roundtrip ("i = 1; 'expr'; raise Exception" , mode = 'single' )
472472 self .check_src_roundtrip ("i: int = 1; j: float = 0; k += l" , mode = 'single' )
473473 combinable = (
@@ -497,7 +497,8 @@ def test_unparse_interactive(self):
497497 for b in combinable :
498498 self .check_src_roundtrip (f"{ a } ; { b } " , mode = 'single' )
499499
500- # rest of the tests just make sure mode='single' parse and unparse didn't break
500+ def test_unparse_interactive_integrity_1 (self ):
501+ # rest of unparse_interactive_integrity tests just make sure mode='single' parse and unparse didn't break
501502 self .check_src_roundtrip (
502503 "if i:\n 'expr'\n else:\n raise Exception" ,
503504 "if i:\n 'expr'\n else:\n raise Exception" ,
@@ -513,6 +514,8 @@ def test_unparse_interactive(self):
513514 '''@decorator1\n @decorator2\n class cls:\n """docstring"""\n i = 1\n 'expr'\n raise Exception''' ,
514515 mode = 'single'
515516 )
517+
518+ def test_unparse_interactive_integrity_2 (self ):
516519 for statement in (
517520 "def x():\n pass" ,
518521 "def x(y):\n pass" ,
@@ -548,6 +551,8 @@ def test_unparse_interactive(self):
548551 "class cls:\n \n def f(self, *args, **kwargs):\n pass" ,
549552 ):
550553 self .check_src_roundtrip (statement , mode = 'single' )
554+
555+ def test_unparse_interactive_integrity_3 (self ):
551556 for statement in (
552557 "def x():" ,
553558 "def x(y):" ,
0 commit comments