MCPcopy Index your code
hub / github.com/ipython/ipython / xsys

Function xsys

tests/conftest.py:50–55  ·  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

48
49
50def xsys(self, cmd):
51 """Replace the default system call with a capturing one for doctest."""
52 # We use getoutput, but we need to strip it because pexpect captures
53 # the trailing newline differently from commands.getoutput
54 print(self.getoutput(cmd, split=False, depth=1).rstrip(), end="", file=sys.stdout)
55 sys.stdout.flush()
56
57
58# 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…