gh-131178: Add tests for ast command-line interface (#133329)

Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
Semyon Moroz 2025-05-05 01:11:13 +04:00 committed by GitHub
parent 40be123499
commit 6ce60f1574
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 167 additions and 17 deletions

View file

@ -626,7 +626,7 @@ def unparse(ast_obj):
return unparser.visit(ast_obj)
def main():
def main(args=None):
import argparse
import sys
@ -643,7 +643,7 @@ def main():
'column offsets')
parser.add_argument('-i', '--indent', type=int, default=3,
help='indentation of nodes (number of spaces)')
args = parser.parse_args()
args = parser.parse_args(args)
if args.infile == '-':
name = '<stdin>'