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

Function test_lazy_magics

tests/test_magic.py:1915–1928  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1913
1914
1915def test_lazy_magics():
1916 with pytest.raises(UsageError):
1917 ip.run_line_magic("lazy_line", "")
1918
1919 startdir = os.getcwd()
1920
1921 with TemporaryDirectory() as tmpdir:
1922 with prepended_to_syspath(tmpdir):
1923 ptempdir = Path(tmpdir)
1924 tf = ptempdir / "lazy_magic_module.py"
1925 tf.write_text(MINIMAL_LAZY_MAGIC)
1926 ip.magics_manager.register_lazy("lazy_line", Path(tf.name).name[:-3])
1927 with tt.AssertPrints("Lazy Line"):
1928 ip.run_line_magic("lazy_line", "")
1929
1930
1931TEST_MODULE = """

Callers

nothing calls this directly

Calls 3

run_line_magicMethod · 0.80
register_lazyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…