##// END OF EJS Templates
Add test for magic macro command.
Thomas Kluyver -
Show More
@@ -173,6 +173,18 b' def test_shist():'
173 173 yield nt.assert_equal,s.get(2),'world'
174 174
175 175 shutil.rmtree(tfile)
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")
176 188
177 189
178 190 # XXX failing for now, until we get clearcmd out of quarantine. But we should
General Comments 0
You need to be logged in to leave comments. Login now