MCPcopy Index your code
hub / github.com/ipython/ipython / test_line_cell_info

Function test_line_cell_info

tests/test_magic.py:1640–1656  ·  view source on GitHub ↗

%%foo and %foo magics are distinguishable to inspect

()

Source from the content-addressed store, hash-verified

1638
1639
1640def test_line_cell_info():
1641 """%%foo and %foo magics are distinguishable to inspect"""
1642 ip = get_ipython()
1643 ip.magics_manager.register(FooFoo)
1644 oinfo = ip.object_inspect("foo")
1645 assert oinfo["found"] is True
1646 assert oinfo["ismagic"] is True
1647
1648 oinfo = ip.object_inspect("%%foo")
1649 assert oinfo["found"] is True
1650 assert oinfo["ismagic"] is True
1651 assert oinfo["docstring"] == FooFoo.cell_foo.__doc__
1652
1653 oinfo = ip.object_inspect("%foo")
1654 assert oinfo["found"] is True
1655 assert oinfo["ismagic"] is True
1656 assert oinfo["docstring"] == FooFoo.line_foo.__doc__
1657
1658
1659def test_multiple_magics():

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
object_inspectMethod · 0.80
registerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…