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

Method test_run_nb

IPython/core/tests/test_run.py:389–403  ·  view source on GitHub ↗

Test %run notebook.ipynb

(self)

Source from the content-addressed store, hash-verified

387 _ip.magic('run -e %s' % self.fname)
388
389 def test_run_nb(self):
390 """Test %run notebook.ipynb"""
391 from nbformat import v4, writes
392 nb = v4.new_notebook(
393 cells=[
394 v4.new_markdown_cell("The Ultimate Question of Everything"),
395 v4.new_code_cell("answer=42")
396 ]
397 )
398 src = writes(nb, version=4)
399 self.mktmp(src, ext='.ipynb')
400
401 _ip.magic("run %s" % self.fname)
402
403 nt.assert_equal(_ip.user_ns['answer'], 42)
404
405 def test_run_nb_error(self):
406 """Test %run notebook.ipynb error"""

Callers

nothing calls this directly

Calls 2

mktmpMethod · 0.80
magicMethod · 0.45

Tested by

no test coverage detected