Add optional parameter forgive=False to reportTest() for use by nls_test to avoid false fails.
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user