If filecmp.cmp failed with an exception due to a missing file,
its exception was being lost due to another issue in the runner.
For this case it makes sense to catch this exception and wrap
it in a TestError exception as its most likely a missing file.
return True;
expected = os.path.join(self.directory, self.config["expected"])
filename = self.config["filename"]
- if filecmp.cmp(expected, filename):
- return True
- else:
- raise TestError("%s %s \nFAILED: verification failed" % (expected, filename))
+ try:
+ if filecmp.cmp(expected, filename):
+ return True
+ else:
+ raise TestError("%s %s \nFAILED: verification failed" % (expected, filename))
+ except Exception as err:
+ raise TestError("file-compare check failed with exception: %s" % (err))
class ShellCheck: