diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-01 11:59:01 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-01 11:59:01 +0000 |
commit | a657020d4e208ab37c18277f75cb0578f34e3ce0 (patch) | |
tree | b1d27e6eb0cc3738fd06b28134919bc2f5026c2c /cmdtest | |
parent | 3d334e94be2dc713a640047380ab1437377c8331 (diff) | |
download | cmdtest-a657020d4e208ab37c18277f75cb0578f34e3ce0.tar.gz |
adapt to new cliapp API and don't redirect stdin unless told to
Diffstat (limited to 'cmdtest')
-rwxr-xr-x | cmdtest | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -137,16 +137,21 @@ class CommandTester(cliapp.Application): if test.args: argv.extend(self.expand(self.lines(test.args))) - stdin = self.cat(test.stdin or '/dev/null') stdout_name = test.path_prefix + '.stdout-actual' stderr_name = test.path_prefix + '.stderr-actual' with open(stdout_name, 'wb') as stdout: with open(stderr_name, 'wb') as stderr: + if test.stdin: + stdin = open(test.stdin, 'rb') + else: + stdin = None exit, out, err = self.runcmd_unchecked(argv, env=self.add_to_env(), stdin=stdin, stdout=stdout, stderr=stderr) + if stdin is not None: + stdin.close() errors = [] |