From 95156ab89b78cfbfcf1df79fb705dbeb7200e77e Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 28 May 2017 13:28:30 -0700 Subject: PY2/3 add support for specifying newline mode to file reads for tests --- QMTest/TestCommon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'QMTest') diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py index c1adc376..a475ddc6 100644 --- a/QMTest/TestCommon.py +++ b/QMTest/TestCommon.py @@ -469,13 +469,13 @@ class TestCommon(TestCmd): print("Missing one of: `%s'" % "', `".join(missing)) self.fail_test(missing) - def must_match(self, file, expect, mode = 'rb', match=None, message=None): + def must_match(self, file, expect, mode = 'rb', match=None, message=None, newline=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 on newlines. """ - file_contents = self.read(file, mode) + file_contents = self.read(file, mode, newline) if not match: match = self.match try: -- cgit v1.2.1