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

Method test_stdin_loader

Lib/test/test_cmd_line_script.py:164–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

162 # TODO: RUSTPYTHON
163 @unittest.expectedFailure
164 def test_stdin_loader(self):
165 # Unfortunately, there's no way to automatically test the fully
166 # interactive REPL, since that code path only gets executed when
167 # stdin is an interactive tty.
168 p = spawn_python()
169 try:
170 p.stdin.write(b"print(__loader__)\n")
171 p.stdin.flush()
172 finally:
173 out = kill_python(p)
174 expected = repr(importlib.machinery.BuiltinImporter).encode("utf-8")
175 self.assertIn(expected, out)
176
177 @contextlib.contextmanager
178 def interactive_python(self, separate_stderr=False):

Callers

nothing calls this directly

Calls 7

spawn_pythonFunction · 0.90
kill_pythonFunction · 0.90
reprFunction · 0.85
assertInMethod · 0.80
writeMethod · 0.45
flushMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected