summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-03-10 12:12:09 +0000
committerLars Wirzenius <liw@liw.fi>2013-03-10 12:12:09 +0000
commitf88197e4bc6913478214f038b8babb7b4e44923d (patch)
tree5f41e87ca3aefeea75446e2003295ea6bce839bb
parented5503e48ec51c3a0884b8da019712495c1baae9 (diff)
downloadcmdtest-f88197e4bc6913478214f038b8babb7b4e44923d.tar.gz
Fix cmdtest so that fail-tests work
-rwxr-xr-xcmdtest3
-rw-r--r--setup.py7
2 files changed, 9 insertions, 1 deletions
diff --git a/cmdtest b/cmdtest
index 581b07a..b8c6efa 100755
--- a/cmdtest
+++ b/cmdtest
@@ -209,7 +209,8 @@ class CommandTester(cliapp.Application):
argv = ['diff', '-u', expected_name, actual_name]
with open(diff_name, 'w') as f:
exit, out, err = self.runcmd_unchecked(argv, stdout=f)
- return out
+ with open(diff_name, 'r') as f:
+ return f.read()
def report_timings(self):
diff --git a/setup.py b/setup.py
index 3b06249..108841a 100644
--- a/setup.py
+++ b/setup.py
@@ -65,6 +65,13 @@ class Check(Command):
subprocess.check_call(['./cmdtest', 'echo-tests'])
subprocess.check_call(['./cmdtest', 'sort-tests'])
+ try:
+ subprocess.check_call(['./cmdtest', 'fail-tests'])
+ except subprocess.CalledProcessError:
+ pass
+ else:
+ raise Exception('fail-tests did not fail, which is a surprise')
+
setup(name='cmdtest',
version=cmdtestlib.__version__,