diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-02-26 04:41:16 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-02-26 04:41:16 (GMT) |
commit | d672220f05ecd77beeaab90042f3dd31def0a102 (patch) | |
tree | d74ef0b6080fde033207ca7e48f7e4f86ca6fb94 | |
parent | b3fbe913fe07395fff65da4f968a5e70c2fe753b (diff) | |
download | SCons-d672220f05ecd77beeaab90042f3dd31def0a102.zip SCons-d672220f05ecd77beeaab90042f3dd31def0a102.tar.gz SCons-d672220f05ecd77beeaab90042f3dd31def0a102.tar.bz2 |
Added ability for must_match to pass message to be output if it fails
-rw-r--r-- | QMTest/TestCommon.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py index 9093cc9..cd9e990 100644 --- a/QMTest/TestCommon.py +++ b/QMTest/TestCommon.py @@ -469,7 +469,7 @@ class TestCommon(TestCmd): print("Missing one of: `%s'" % "', `".join(missing)) self.fail_test(missing) - def must_match(self, file, expect, mode = 'rb', match=None): + def must_match(self, file, expect, mode = 'rb', match=None, message=None): """Matches the contents of the specified file (first argument) against the expected contents (second argument). The expected contents are a list of lines or a string which will be split @@ -479,7 +479,7 @@ class TestCommon(TestCmd): if not match: match = self.match try: - self.fail_test(not match(to_str(file_contents), to_str(expect))) + self.fail_test(not match(to_str(file_contents), to_str(expect)), message=message) except KeyboardInterrupt: raise except: |