Replace the default system call with a capturing one for doctest.
(self, cmd)
| 40 | |
| 41 | |
| 42 | def 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; |