MCPcopy Index your code
hub / github.com/python/cpython / test_eval_mode_flag

Method test_eval_mode_flag

Lib/test/test_ast/test_ast.py:3512–3526  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3510 self.check_output(source, expect, flag)
3511
3512 def test_eval_mode_flag(self):
3513 # test 'python -m ast -m/--mode eval'
3514 source = 'print(1, 2, 3)'
3515 expect = '''
3516 Expression(
3517 body=Call(
3518 func=Name(id='print'),
3519 args=[
3520 Constant(value=1),
3521 Constant(value=2),
3522 Constant(value=3)]))
3523 '''
3524 for flag in ('-m=eval', '--mode=eval'):
3525 with self.subTest(flag=flag):
3526 self.check_output(source, expect, flag)
3527
3528 def test_func_type_mode_flag(self):
3529 # test 'python -m ast -m/--mode func_type'

Callers

nothing calls this directly

Calls 2

check_outputMethod · 0.95
subTestMethod · 0.45

Tested by

no test coverage detected