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

Function test_script_tb

IPython/core/tests/test_run.py:591–606  ·  view source on GitHub ↗

Test traceback offset in `ipython script.py`

()

Source from the content-addressed store, hash-verified

589
590@dec.knownfailureif(sys.platform == 'win32', "writes to io.stdout aren't captured on Windows")
591def test_script_tb():
592 """Test traceback offset in `ipython script.py`"""
593 with TemporaryDirectory() as td:
594 path = pjoin(td, 'foo.py')
595 with open(path, 'w') as f:
596 f.write('\n'.join([
597 "def foo():",
598 " return bar()",
599 "def bar():",
600 " raise RuntimeError('hello!')",
601 "foo()",
602 ]))
603 out, err = tt.ipexec(path)
604 nt.assert_not_in("execfile", out)
605 nt.assert_in("RuntimeError", out)
606 nt.assert_equal(out.count("---->"), 3)
607

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected