Make sure commands are added to IPython's history
(self)
| 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""" |
nothing calls this directly
no test coverage detected