diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-03-10 12:12:09 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-03-10 12:12:09 +0000 |
commit | f88197e4bc6913478214f038b8babb7b4e44923d (patch) | |
tree | 5f41e87ca3aefeea75446e2003295ea6bce839bb | |
parent | ed5503e48ec51c3a0884b8da019712495c1baae9 (diff) | |
download | cmdtest-f88197e4bc6913478214f038b8babb7b4e44923d.tar.gz |
Fix cmdtest so that fail-tests work
-rwxr-xr-x | cmdtest | 3 | ||||
-rw-r--r-- | setup.py | 7 |
2 files changed, 9 insertions, 1 deletions
@@ -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): @@ -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__, |