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

Function xsys

IPython/conftest.py:42–48  ·  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

40
41
42def xsys(self, cmd):
43 """Replace the default system call with a capturing one for doctest.
44 """
45 # We use getoutput, but we need to strip it because pexpect captures
46 # the trailing newline differently from commands.getoutput
47 print(self.getoutput(cmd, split=False, depth=1).rstrip(), end="", file=sys.stdout)
48 sys.stdout.flush()
49
50
51# for things to work correctly we would need this as a session fixture;

Callers

nothing calls this directly

Calls 2

getoutputMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected