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