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

Method test_empty

Lib/test/test_pyrepl/test_interact.py:70–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 self.assertNotIn('spam&eggs', f.getvalue())
69
70 def test_empty(self):
71 namespace = {}
72 code = ""
73 console = InteractiveColoredConsole(namespace, filename="<stdin>")
74 f = io.StringIO()
75 with contextlib.redirect_stdout(f):
76 more = console.push(code, filename="<stdin>", _symbol="single") # type: ignore[call-arg]
77 self.assertFalse(more)
78 self.assertEqual(f.getvalue(), "")
79
80 def test_runsource_compiles_and_runs_code(self):
81 console = InteractiveColoredConsole()

Callers

nothing calls this directly

Calls 5

getvalueMethod · 0.95
assertFalseMethod · 0.80
pushMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected