MCPcopy Create free account
hub / github.com/ipython/ipython / test_line_cell_info

Function test_line_cell_info

IPython/core/tests/test_magic.py:1026–1042  ·  view source on GitHub ↗

%%foo and %foo magics are distinguishable to inspect

()

Source from the content-addressed store, hash-verified

1024 pass
1025
1026def test_line_cell_info():
1027 """%%foo and %foo magics are distinguishable to inspect"""
1028 ip = get_ipython()
1029 ip.magics_manager.register(FooFoo)
1030 oinfo = ip.object_inspect('foo')
1031 nt.assert_true(oinfo['found'])
1032 nt.assert_true(oinfo['ismagic'])
1033
1034 oinfo = ip.object_inspect('%%foo')
1035 nt.assert_true(oinfo['found'])
1036 nt.assert_true(oinfo['ismagic'])
1037 nt.assert_equal(oinfo['docstring'], FooFoo.cell_foo.__doc__)
1038
1039 oinfo = ip.object_inspect('%foo')
1040 nt.assert_true(oinfo['found'])
1041 nt.assert_true(oinfo['ismagic'])
1042 nt.assert_equal(oinfo['docstring'], FooFoo.line_foo.__doc__)
1043
1044def test_multiple_magics():
1045 ip = get_ipython()

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
object_inspectMethod · 0.80
registerMethod · 0.45

Tested by

no test coverage detected