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

Method invoke_ast

Lib/test/test_ast/test_ast.py:3430–3439  ·  view source on GitHub ↗
(self, *flags)

Source from the content-addressed store, hash-verified

3428 Path(self.filename).write_text(self.text_normalize(content))
3429
3430 def invoke_ast(self, *flags):
3431 stderr = StringIO()
3432 stdout = StringIO()
3433 with (
3434 contextlib.redirect_stdout(stdout),
3435 contextlib.redirect_stderr(stderr),
3436 ):
3437 ast.main(args=[*flags, self.filename])
3438 self.assertEqual(stderr.getvalue(), '')
3439 return stdout.getvalue().strip()
3440
3441 def check_output(self, source, expect, *flags):
3442 self.set_source(source)

Callers 3

check_outputMethod · 0.95
test_invocationMethod · 0.95

Calls 5

getvalueMethod · 0.95
StringIOClass · 0.90
mainMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected