()
| 288 | |
| 289 | |
| 290 | def test_macro(): |
| 291 | ip = get_ipython() |
| 292 | ip.history_manager.reset() # Clear any existing history. |
| 293 | cmds = ["a=1", "def b():\n return a**2", "print(a,b())"] |
| 294 | for i, cmd in enumerate(cmds, start=1): |
| 295 | ip.history_manager.store_inputs(i, cmd) |
| 296 | ip.run_line_magic("macro", "test 1-3") |
| 297 | assert ip.user_ns["test"].value == "\n".join(cmds) + "\n" |
| 298 | |
| 299 | # List macros |
| 300 | assert "test" in ip.run_line_magic("macro", "") |
| 301 | |
| 302 | |
| 303 | def test_macro_run(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…