Replace the default system call with a capturing one for doctest.
(self, cmd)
| 55 | # various types of output there otherwise it will miss them). |
| 56 | |
| 57 | def 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 | |
| 66 | def _showtraceback(self, etype, evalue, stb): |