MCPcopy Index your code
hub / github.com/RustPython/RustPython / invoke_ast

Method invoke_ast

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

Source from the content-addressed store, hash-verified

3454 Path(self.filename).write_text(self.text_normalize(content))
3455
3456 def invoke_ast(self, *flags):
3457 stderr = StringIO()
3458 stdout = StringIO()
3459 with (
3460 contextlib.redirect_stdout(stdout),
3461 contextlib.redirect_stderr(stderr),
3462 ):
3463 ast.main(args=[*flags, self.filename])
3464 self.assertEqual(stderr.getvalue(), '')
3465 return stdout.getvalue().strip()
3466
3467 def check_output(self, source, expect, *flags):
3468 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