Test %%prun with IPython special syntax
()
| 951 | |
| 952 | @dec.skipif(execution.profile is None) |
| 953 | def test_prun_special_syntax(): |
| 954 | "Test %%prun with IPython special syntax" |
| 955 | |
| 956 | @register_line_magic |
| 957 | def lmagic(line): |
| 958 | ip = get_ipython() |
| 959 | ip.user_ns["lmagic_out"] = line |
| 960 | |
| 961 | # line mode test |
| 962 | _ip.run_line_magic("prun", "-q %lmagic my line") |
| 963 | assert _ip.user_ns["lmagic_out"] == "my line" |
| 964 | # cell mode test |
| 965 | _ip.run_cell_magic("prun", "-q", "%lmagic my line2") |
| 966 | assert _ip.user_ns["lmagic_out"] == "my line2" |
| 967 | |
| 968 | |
| 969 | @dec.skipif(execution.profile is None) |
nothing calls this directly
no test coverage detected
searching dependent graphs…