Add optional parameter forgive=False to reportTest() for use by nls_test to avoid false fails.

This commit is contained in:
Robin Mills
2021-03-18 16:50:53 +00:00
parent 4b6abcf199
commit 5c13660f1e
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -898,7 +898,7 @@ set Exif.Photo.DateTimeDigitized 2020:05:26 07:31:42
for language in ['fr_FR', 'es_ES']:
e = BT.Executer(cmd='exiv2', extra_env={'LC_ALL': language, LANG: language}, assert_returncode=[1], decode_output=False)
out += e.stdout.split(b'\n')[0].decode()
BT.reportTest('nls-test', out)
BT.reportTest('nls-test', out,forgive=True)
def path_test(self):
+5 -2
View File
@@ -546,7 +546,7 @@ class Output:
return self.__add__(other)
def reportTest(testname, output: str, encoding=None):
def reportTest(testname, output: str, encoding=None,forgive=False):
""" If the output of the test case is correct, this function returns None. Otherwise print its error. """
output = str(output) + '\n'
encoding = encoding or Config.encoding
@@ -559,7 +559,10 @@ def reportTest(testname, output: str, encoding=None):
save(output, output_file, encoding=encoding)
log.info('The output has been saved to file {}'.format(output_file))
log.info('simply_diff:\n' + str(simply_diff(reference_file, output_file, encoding=encoding)))
raise RuntimeError('\n' + log.to_str())
if forgive:
print('Forgive: simply_diff:\n' + str(simply_diff(reference_file, output_file, encoding=encoding)))
else:
raise RuntimeError('\n' + log.to_str())
def ioTest(filename):