Replace the default system call with a capturing one for doctest.
(self, cmd)
| 32 | # various types of output there otherwise it will miss them). |
| 33 | |
| 34 | def xsys(self, cmd): |
| 35 | """Replace the default system call with a capturing one for doctest. |
| 36 | """ |
| 37 | # We use getoutput, but we need to strip it because pexpect captures |
| 38 | # the trailing newline differently from commands.getoutput |
| 39 | print(self.getoutput(cmd, split=False, depth=1).rstrip(), end='', file=sys.stdout) |
| 40 | sys.stdout.flush() |
| 41 | |
| 42 | |
| 43 | def _showtraceback(self, etype, evalue, stb): |