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

Function test_time_local_ns

IPython/core/tests/test_magic.py:470–478  ·  view source on GitHub ↗

Test that local_ns is actually global_ns when running a cell magic

()

Source from the content-addressed store, hash-verified

468 nt.assert_equal(ip.user_ns_hidden['_'], 'hohey')
469
470def test_time_local_ns():
471 """
472 Test that local_ns is actually global_ns when running a cell magic
473 """
474 ip = get_ipython()
475 ip.run_cell("%%time\n"
476 "myvar = 1")
477 nt.assert_equal(ip.user_ns['myvar'], 1)
478 del ip.user_ns['myvar']
479
480def test_doctest_mode():
481 "Toggle doctest_mode twice, it should be a no-op and run without error"

Callers

nothing calls this directly

Calls 2

get_ipythonFunction · 0.90
run_cellMethod · 0.45

Tested by

no test coverage detected