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

Function xsys

IPython/testing/globalipapp.py:57–63  ·  view source on GitHub ↗

Replace the default system call with a capturing one for doctest.

(self, cmd)

Source from the content-addressed store, hash-verified

55# various types of output there otherwise it will miss them).
56
57def xsys(self, cmd):
58 """Replace the default system call with a capturing one for doctest.
59 """
60 # We use getoutput, but we need to strip it because pexpect captures
61 # the trailing newline differently from commands.getoutput
62 print(self.getoutput(cmd, split=False, depth=1).rstrip(), end='', file=sys.stdout)
63 sys.stdout.flush()
64
65
66def _showtraceback(self, etype, evalue, stb):

Callers

nothing calls this directly

Calls 2

getoutputMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected