(self)
| 3480 | self.assertStartsWith(output.getvalue(), 'usage: ') |
| 3481 | |
| 3482 | def test_exec_mode_flag(self): |
| 3483 | # test 'python -m ast -m/--mode exec' |
| 3484 | source = 'x: bool = 1 # type: ignore[assignment]' |
| 3485 | expect = ''' |
| 3486 | Module( |
| 3487 | body=[ |
| 3488 | AnnAssign( |
| 3489 | target=Name(id='x', ctx=Store()), |
| 3490 | annotation=Name(id='bool'), |
| 3491 | value=Constant(value=1), |
| 3492 | simple=1)], |
| 3493 | type_ignores=[ |
| 3494 | TypeIgnore(lineno=1, tag='[assignment]')]) |
| 3495 | ''' |
| 3496 | for flag in ('-m=exec', '--mode=exec'): |
| 3497 | with self.subTest(flag=flag): |
| 3498 | self.check_output(source, expect, flag) |
| 3499 | |
| 3500 | def test_single_mode_flag(self): |
| 3501 | # test 'python -m ast -m/--mode single' |
nothing calls this directly
no test coverage detected