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