MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_history

Method test_history

tests/test_pydev_ipython_011.py:169–186  ·  view source on GitHub ↗

Make sure commands are added to IPython's history

(self)

Source from the content-addressed store, hash-verified

167 assert get_inputhook() is None
168
169 def test_history(self):
170 """Make sure commands are added to IPython's history"""
171 self.redirect_stdout()
172 try:
173 self.add_exec("a=1")
174 self.add_exec("b=2")
175 _ih = self.front_end.get_namespace()["_ih"]
176 eq_(_ih[-1], "b=2")
177 eq_(_ih[-2], "a=1")
178
179 self.add_exec("history")
180 hist = sys.stdout.getvalue().split("\n")
181 eq_(hist[-1], "")
182 eq_(hist[-2], "history")
183 eq_(hist[-3], "b=2")
184 eq_(hist[-4], "a=1")
185 finally:
186 self.restore_stdout()
187
188 def test_edit(self):
189 """Make sure we can issue an edit command"""

Callers

nothing calls this directly

Calls 6

eq_Function · 0.85
redirect_stdoutMethod · 0.80
getvalueMethod · 0.80
restore_stdoutMethod · 0.80
add_execMethod · 0.45
get_namespaceMethod · 0.45

Tested by

no test coverage detected