##// END OF EJS Templates
Add test for magic macro command.
Thomas Kluyver -
Show More
@@ -174,6 +174,18 b' def test_shist():'
174
174
175 shutil.rmtree(tfile)
175 shutil.rmtree(tfile)
176
176
177 def test_macro():
178 ip = get_ipython()
179 ip.history_manager.reset() # Clear any existing history.
180 cmds = ["a=1", "def b():\n return a**2", "print(a,b())"]
181 for cmd in cmds:
182 ip.history_manager.store_inputs(cmd)
183 ip.magic("macro test 1-3")
184 nt.assert_equal(ip.user_ns["test"].value, "\n".join(cmds)+"\n")
185
186 # List macros. This goes to stdout, so just check it doesn't crash.
187 ip.magic("macro")
188
177
189
178 # XXX failing for now, until we get clearcmd out of quarantine. But we should
190 # XXX failing for now, until we get clearcmd out of quarantine. But we should
179 # fix this and revert the skip to happen only if numpy is not around.
191 # fix this and revert the skip to happen only if numpy is not around.
General Comments 0
You need to be logged in to leave comments. Login now