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

Method test_ignore_sys_exit

IPython/core/tests/test_run.py:379–387  ·  view source on GitHub ↗

Test the -e option to ignore sys.exit()

(self)

Source from the content-addressed store, hash-verified

377 _ip.magic('run -t -N 10 %s' % self.fname)
378
379 def test_ignore_sys_exit(self):
380 """Test the -e option to ignore sys.exit()"""
381 src = "import sys; sys.exit(1)"
382 self.mktmp(src)
383 with tt.AssertPrints('SystemExit'):
384 _ip.magic('run %s' % self.fname)
385
386 with tt.AssertNotPrints('SystemExit'):
387 _ip.magic('run -e %s' % self.fname)
388
389 def test_run_nb(self):
390 """Test %run notebook.ipynb"""

Callers

nothing calls this directly

Calls 2

mktmpMethod · 0.80
magicMethod · 0.45

Tested by

no test coverage detected