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

Function test_autorestore

IPython/extensions/tests/test_storemagic.py:51–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 os.rmdir(tmpd)
50
51def test_autorestore():
52 ip.user_ns['foo'] = 95
53 ip.magic('store foo')
54 del ip.user_ns['foo']
55 c = Config()
56 c.StoreMagics.autorestore = False
57 orig_config = ip.config
58 try:
59 ip.config = c
60 ip.extension_manager.reload_extension('storemagic')
61 nt.assert_not_in('foo', ip.user_ns)
62 c.StoreMagics.autorestore = True
63 ip.extension_manager.reload_extension('storemagic')
64 nt.assert_equal(ip.user_ns['foo'], 95)
65 finally:
66 ip.config = orig_config

Callers

nothing calls this directly

Calls 2

reload_extensionMethod · 0.80
magicMethod · 0.45

Tested by

no test coverage detected