diff options
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 = [] |