@@ -486,6 +486,7 @@ class User(SQLAlchemyBase):
486
486
487
487
488
488
@pytest .mark .skipif (sys .version_info < (3 , 9 ), reason = 'no indent on older versions' )
489
+ @pytest .mark .skipif (sys .version_info >= (3 , 13 ), reason = 'show_empty=False on newer versions' )
489
490
def test_ast_expr ():
490
491
assert pformat (ast .parse ('print(1, 2, round(3))' , mode = 'eval' )) == (
491
492
"Expression("
@@ -503,6 +504,22 @@ def test_ast_expr():
503
504
)
504
505
505
506
507
+ @pytest .mark .skipif (sys .version_info < (3 , 13 ), reason = 'no show_empty on older versions' )
508
+ def test_ast_expr_show_empty ():
509
+ assert pformat (ast .parse ('print(1, 2, round(3))' , mode = 'eval' )) == (
510
+ "Expression("
511
+ "\n body=Call("
512
+ "\n func=Name(id='print', ctx=Load()),"
513
+ "\n args=["
514
+ "\n Constant(value=1),"
515
+ "\n Constant(value=2),"
516
+ "\n Call("
517
+ "\n func=Name(id='round', ctx=Load()),"
518
+ "\n args=["
519
+ "\n Constant(value=3)])]))"
520
+ )
521
+
522
+
506
523
@pytest .mark .skipif (sys .version_info < (3 , 9 ), reason = 'no indent on older versions' )
507
524
def test_ast_module ():
508
525
assert pformat (ast .parse ('print(1, 2, round(3))' )).startswith ('Module(\n body=[' )
0 commit comments