Test that we can run a multi-line macro successfully.
()
| 301 | |
| 302 | |
| 303 | def test_macro_run(): |
| 304 | """Test that we can run a multi-line macro successfully.""" |
| 305 | ip = get_ipython() |
| 306 | ip.history_manager.reset() |
| 307 | cmds = ["a=10", "a+=1", "print(a)", "%macro test 2-3"] |
| 308 | for cmd in cmds: |
| 309 | ip.run_cell(cmd, store_history=True) |
| 310 | assert ip.user_ns["test"].value == "a+=1\nprint(a)\n" |
| 311 | with tt.AssertPrints("12"): |
| 312 | ip.run_cell("test") |
| 313 | with tt.AssertPrints("13"): |
| 314 | ip.run_cell("test") |
| 315 | |
| 316 | |
| 317 | def test_magic_magic(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…