From a657020d4e208ab37c18277f75cb0578f34e3ce0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 1 Dec 2011 11:59:01 +0000 Subject: adapt to new cliapp API and don't redirect stdin unless told to --- cmdtest | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmdtest') diff --git a/cmdtest b/cmdtest index e84602b..fc362ef 100755 --- a/cmdtest +++ b/cmdtest @@ -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 = [] -- cgit v1.2.1