MCPcopy Index your code
hub / github.com/bpython/bpython / test_interactive

Method test_interactive

bpython/test/test_curtsies_repl.py:253–264  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

251 self.assertEqual(out.getvalue(), "0.5\n")
252
253 def test_interactive(self):
254 interp = code.InteractiveInterpreter(locals={})
255 with captured_output() as (out, err):
256 with tempfile.NamedTemporaryFile(mode="w", suffix=".py") as f:
257 f.write("print(1/2)\n")
258 f.flush()
259 args.exec_code(interp, [f.name])
260
261 repl = create_repl(interp=interp)
262 repl.push("1 / 2")
263
264 self.assertEqual(out.getvalue(), "0.5\n0.5\n")
265
266
267class TestStdOutErr(TestCase):

Callers

nothing calls this directly

Calls 5

captured_outputFunction · 0.85
create_replFunction · 0.70
writeMethod · 0.45
flushMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected