@@ -486,6 +486,7 @@ class User(SQLAlchemyBase):
486486
487487
488488@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' )
489490def test_ast_expr ():
490491 assert pformat (ast .parse ('print(1, 2, round(3))' , mode = 'eval' )) == (
491492 "Expression("
@@ -503,6 +504,22 @@ def test_ast_expr():
503504 )
504505
505506
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+
506523@pytest .mark .skipif (sys .version_info < (3 , 9 ), reason = 'no indent on older versions' )
507524def test_ast_module ():
508525 assert pformat (ast .parse ('print(1, 2, round(3))' )).startswith ('Module(\n body=[' )
0 commit comments