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

Function test_autorestore

tests/test_storemagic.py:57–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56
57def test_autorestore():
58 ip.user_ns["foo"] = 95
59 ip.run_line_magic("store", "foo")
60 del ip.user_ns["foo"]
61 c = Config()
62 c.StoreMagics.autorestore = False
63 orig_config = ip.config
64 try:
65 ip.config = c
66 ip.extension_manager.reload_extension("storemagic")
67 assert "foo" not in ip.user_ns
68 c.StoreMagics.autorestore = True
69 ip.extension_manager.reload_extension("storemagic")
70 assert ip.user_ns["foo"] == 95
71 finally:
72 ip.config = orig_config

Callers

nothing calls this directly

Calls 2

run_line_magicMethod · 0.80
reload_extensionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…