diff --git a/conanfile.py b/conanfile.py index 3d869d831b..b859944a89 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,6 +1,5 @@ from conans import ConanFile from conans.tools import os_info -from conans.model.version import Version class Exiv2Conan(ConanFile): settings = 'os', 'compiler', 'build_type', 'arch' diff --git a/doc/templates/gen.py b/doc/templates/gen.py index afc390d18a..7e386d0a72 100755 --- a/doc/templates/gen.py +++ b/doc/templates/gen.py @@ -1,4 +1,9 @@ #! /usr/bin/env python +import sys +import os +import re +import time + # ---------------------------------------------------------------------- # Settings vardir = "." @@ -28,11 +33,6 @@ def last_modified(text): # ---------------------------------------------------------------------- # main -import sys -import os -import re -import time - # Check command line arguments if len(sys.argv) == 1: usage() @@ -44,7 +44,8 @@ def last_modified(text): # Get a list of all variables (files in the form __*__) from vardir vars = os.listdir(vardir) for i in range(len(vars)-1, -1, -1): - if re.match("^__.*__$", vars[i]): continue + if re.match("^__.*__$", vars[i]): + continue del vars[i] vars.sort() diff --git a/tests/bash_tests/testcases.py b/tests/bash_tests/testcases.py index 437f900e3e..df69a2e8c0 100644 --- a/tests/bash_tests/testcases.py +++ b/tests/bash_tests/testcases.py @@ -2,9 +2,9 @@ import re import unittest +from importlib.util import find_spec from system_tests import BT - class TestCases(unittest.TestCase): @@ -368,25 +368,25 @@ def exiv2_test(self): out += BT.Executer('exiv2 -u -h') out += '\n\nAdjust -------------------------------------------------------------------' - out += BT.Executer('exiv2 -u -v -a-12:01:01 adjust {images_1_str}', vars(), assert_returncode=[253]) + out += BT.Executer('exiv2 -u -v -a-12:01:01 adjust {}'.format(images_1_str), vars(), assert_returncode=[253]) out += '\nRename -------------------------------------------------------------------' - out += BT.Executer('exiv2 -u -vf rename {images_1_str}', vars(), assert_returncode=[253]) + out += BT.Executer('exiv2 -u -vf rename {}'.format(images_1_str), vars(), assert_returncode=[253]) out += '\nPrint --------------------------------------------------------------------' - out += BT.Executer('exiv2 -u -v print {images_2_str}', vars(), assert_returncode=[253]) + out += BT.Executer('exiv2 -u -v print {}'.format(images_2_str), vars(), assert_returncode=[253]) out += '' - out += BT.Executer('exiv2 -u -v -b -pt print {images_2_str}', vars()) - e = BT.Executer('exiv2 -u -v -b -pt print {images_2_str}', vars(), redirect_stderr_to_stdout=False, decode_output=False) + out += BT.Executer('exiv2 -u -v -b -pt print {}'.format(images_2_str), vars()) + e = BT.Executer('exiv2 -u -v -b -pt print {}'.format(images_2_str), vars(), redirect_stderr_to_stdout=False, decode_output=False) BT.save(e.stdout, 'iii') out += e.stderr.decode() out += '\nExtract Exif data --------------------------------------------------------' - out += BT.Executer('exiv2 -u -vf extract {images_2_str}', vars()) + out += BT.Executer('exiv2 -u -vf extract {}'.format(images_2_str), vars()) out += '\nExtract Thumbnail --------------------------------------------------------' - out += BT.Executer('exiv2 -u -vf -et extract {images_2_str}', vars(), assert_returncode=[253]) - e = BT.Executer('exiv2 -u -v -b -pt print {images_3_str}', vars(), redirect_stderr_to_stdout=False, decode_output=False) + out += BT.Executer('exiv2 -u -vf -et extract {}'.format(images_2_str), vars(), assert_returncode=[253]) + e = BT.Executer('exiv2 -u -v -b -pt print {}'.format(images_3_str), vars(), redirect_stderr_to_stdout=False, decode_output=False) BT.save(e.stdout, 'jjj') out += e.stderr.decode() @@ -1013,9 +1013,7 @@ def preview_test(self): def stdin_test(self): return # temporarily disable # Test driver for stdin - try: - import lxml - except ModuleNotFoundError: + if find_spec('lxml') is None: print('Skipped. Because it misses module lxml. Please install: `pip install lxml`') return @@ -1334,8 +1332,8 @@ def xmpparser_test(self): out += BT.diff(img, img + '-new') xmp = 'xmpsdk.xmp' - BT.save(BT.Executer('xmpparse {xmp}' , vars()).stdout, 't1') - BT.save(BT.Executer('xmpparse {xmp}-new', vars()).stdout, 't2') + BT.save(BT.Executer('xmpparse {}'.format(xmp), vars()).stdout, 't1') + BT.save(BT.Executer('xmpparse {}-new'.format(xmp), vars()).stdout, 't2') out += BT.diff('t1', 't2') out += BT.Executer('xmpsample') diff --git a/tests/bash_tests/utils.py b/tests/bash_tests/utils.py index 3a3012c3b9..e0fb6afe9f 100644 --- a/tests/bash_tests/utils.py +++ b/tests/bash_tests/utils.py @@ -364,8 +364,8 @@ def start(self): with request.urlopen('http://127.0.0.1:{}'.format(self.port), timeout=3) as f: if f.status != 200: raise RuntimeError() - except: - raise RuntimeError('Failed to run the HTTP server') + except Exception as e: + raise RuntimeError('Failed to run the HTTP server: {}'.format(e)) log.info('The HTTP server started') def stop(self): @@ -504,8 +504,8 @@ def run(self): except subprocess.TimeoutExpired: self.subprocess.kill() output = self.subprocess.communicate() - except: - raise RuntimeError('Failed to execute: {}'.format(self.args)) + except Exception as e: + raise RuntimeError('Failed to execute {}: {}'.format(self.args, e)) output = [i or b'' for i in output] output = [i.rstrip(b'\r\n').rstrip(b'\n') for i in output] # Remove the last line break of the output @@ -556,7 +556,7 @@ def __str__(self): def __add__(self, other): if isinstance(other, Executer): other = other.stdout - if other != None: + if other is not None: self.lines.append(str(other)) return self @@ -605,7 +605,7 @@ def copyTest(num, src, good): src_file = os.path.join(Config.data_dir, src) good_file = os.path.join(Config.data_dir, '{}.c{}gd'.format(good, num)) copyTestFile(good, test_file) - Executer('metacopy -a {src_file} {test_file}', vars()) + Executer('metacopy -a {} {}'.format(src_file, test_file), vars()) return diffCheck(good_file, test_file, in_bytes=True) @@ -614,7 +614,7 @@ def iptcTest(num, src, good): src_file = os.path.join(Config.data_dir, src) good_file = os.path.join(Config.data_dir, '{}.i{}gd'.format(good, num)) copyTestFile(good, test_file) - Executer('metacopy -ip {src_file} {test_file}', vars()) + Executer('metacopy -ip {} {}'.format(src_file, test_file), vars()) return diffCheck(good_file, test_file, in_bytes=True) @@ -624,7 +624,7 @@ def printTest(filename): good_file = os.path.join(Config.data_dir, filename + '.ipgd') copyTestFile(filename, test_file) - e = Executer('iptcprint {src_file}', vars(), assert_returncode=None, decode_output=False) + e = Executer('iptcprint {}'.format(src_file), vars(), assert_returncode=None, decode_output=False) stdout = e.stdout.replace(Config.data_dir.replace(os.path.sep, '/').encode(), b'../data') # Ignore the difference of data_dir on Windows save(stdout + b'\n', test_file) @@ -743,8 +743,8 @@ def runTest(cmd,raw=False): print('{} returncode = {}'.format(cmd, p.returncode)) # Split the output by newline out = stdout.decode('utf-8').replace('\r', '').rstrip('\n').split('\n') - except: - print('** {} died **'.format(cmd)) + except Exception as e: + print('** {} died: {} **'.format(cmd, e)) return out @@ -758,7 +758,7 @@ def verbose_version(verbose=False): kv = line.rstrip().split('=') if len(kv) == 2: key, val = kv - if not key in vv: + if key not in vv: vv[key] = val elif isinstance(vv[key], list): vv[key].append(val) diff --git a/tests/bugfixes/github/test_issue_1097.py b/tests/bugfixes/github/test_issue_1097.py index f2b4d01ac2..a7dc0b5627 100644 --- a/tests/bugfixes/github/test_issue_1097.py +++ b/tests/bugfixes/github/test_issue_1097.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class InfiniteRecursionInCiffDirectoryReadDirectory(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_1099.py b/tests/bugfixes/github/test_issue_1099.py index 8635219a08..b3bc10bd2d 100644 --- a/tests/bugfixes/github/test_issue_1099.py +++ b/tests/bugfixes/github/test_issue_1099.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class EmptyValueInCommandFile(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_1805.py b/tests/bugfixes/github/test_issue_1805.py index 12ac83014b..6696d6e778 100644 --- a/tests/bugfixes/github/test_issue_1805.py +++ b/tests/bugfixes/github/test_issue_1805.py @@ -2,7 +2,7 @@ import unittest import system_tests -from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors # Check that `exiv2 -pr` works for different file types. # ExifTool has a list of markers that appear in the headers: diff --git a/tests/bugfixes/github/test_issue_1812.py b/tests/bugfixes/github/test_issue_1812.py index 803b9e1934..f8b75b72c9 100644 --- a/tests/bugfixes/github/test_issue_1812.py +++ b/tests/bugfixes/github/test_issue_1812.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class OutOfMemoryInJp2ImageReadMetadata(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_1819.py b/tests/bugfixes/github/test_issue_1819.py index 10f2500cfe..5f2ce1f1f1 100644 --- a/tests/bugfixes/github/test_issue_1819.py +++ b/tests/bugfixes/github/test_issue_1819.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class EmptyStringXmpTextValueRead(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_1827.py b/tests/bugfixes/github/test_issue_1827.py index 3f9c4eaf3f..c944a1eca3 100644 --- a/tests/bugfixes/github/test_issue_1827.py +++ b/tests/bugfixes/github/test_issue_1827.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors class ExposureTimeCastDoubleToLong(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_1830.py b/tests/bugfixes/github/test_issue_1830.py index 99e047fb9c..2a59d927b0 100644 --- a/tests/bugfixes/github/test_issue_1830.py +++ b/tests/bugfixes/github/test_issue_1830.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors class ValueTypeFloatToLong(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_1941.py b/tests/bugfixes/github/test_issue_1941.py index f4da62daba..a5318d278a 100644 --- a/tests/bugfixes/github/test_issue_1941.py +++ b/tests/bugfixes/github/test_issue_1941.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import system_tests -from system_tests import CaseMeta, CopyTmpFiles, path +from system_tests import CaseMeta class TestNikonFl7GroupWithFlash(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_2339.py b/tests/bugfixes/github/test_issue_2339.py index b9e63ced9c..a2c24fdf93 100644 --- a/tests/bugfixes/github/test_issue_2339.py +++ b/tests/bugfixes/github/test_issue_2339.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2339_printDegrees_integer_overflow(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2339" diff --git a/tests/bugfixes/github/test_issue_2352.py b/tests/bugfixes/github/test_issue_2352.py index c48b86e0ca..c3114327b9 100644 --- a/tests/bugfixes/github/test_issue_2352.py +++ b/tests/bugfixes/github/test_issue_2352.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2352_floatToRationalCast_integer_overflow(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2352" diff --git a/tests/bugfixes/github/test_issue_2366.py b/tests/bugfixes/github/test_issue_2366.py index e7c26f3b30..e7111d593a 100644 --- a/tests/bugfixes/github/test_issue_2366.py +++ b/tests/bugfixes/github/test_issue_2366.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2366_QuickTimeVideo_userDataDecoder_buffer_overflow(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2366" diff --git a/tests/bugfixes/github/test_issue_2376.py b/tests/bugfixes/github/test_issue_2376.py index 2afdbc9657..af1a0d0379 100644 --- a/tests/bugfixes/github/test_issue_2376.py +++ b/tests/bugfixes/github/test_issue_2376.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2376_QuickTimeVideo_userDataDecoder_null_deref(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2376" diff --git a/tests/bugfixes/github/test_issue_2377.py b/tests/bugfixes/github/test_issue_2377.py index 010a46685c..c328624fbb 100644 --- a/tests/bugfixes/github/test_issue_2377.py +++ b/tests/bugfixes/github/test_issue_2377.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2377_QuickTimeVideo_userDataDecoder_buffer_overflow(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2377" diff --git a/tests/bugfixes/github/test_issue_2383.py b/tests/bugfixes/github/test_issue_2383.py index f71f519831..cd3e99abf1 100644 --- a/tests/bugfixes/github/test_issue_2383.py +++ b/tests/bugfixes/github/test_issue_2383.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2383_QuickTimeVideo_userDataDecoder_null_deref(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2383" diff --git a/tests/bugfixes/github/test_issue_2393.py b/tests/bugfixes/github/test_issue_2393.py index 5b37dd3550..438d635bc4 100644 --- a/tests/bugfixes/github/test_issue_2393.py +++ b/tests/bugfixes/github/test_issue_2393.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2393_QuickTimeVideo_multipleEntriesDecoder_long_running(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2393" diff --git a/tests/bugfixes/github/test_issue_2403.py b/tests/bugfixes/github/test_issue_2403.py index 0144590ca5..390f48e618 100644 --- a/tests/bugfixes/github/test_issue_2403.py +++ b/tests/bugfixes/github/test_issue_2403.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, CopyTmpFiles @CopyTmpFiles("$data_path/issue_2403_poc.exv") class checkIconvSegFault(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_2423.py b/tests/bugfixes/github/test_issue_2423.py index 0c633cf681..1b3171e7e7 100644 --- a/tests/bugfixes/github/test_issue_2423.py +++ b/tests/bugfixes/github/test_issue_2423.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta class issue_2423_QuickTimeVideo_sampleDesc_long_running(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/2423" diff --git a/tests/bugfixes/github/test_issue_646.py b/tests/bugfixes/github/test_issue_646.py index b836d43298..76bdb31318 100644 --- a/tests/bugfixes/github/test_issue_646.py +++ b/tests/bugfixes/github/test_issue_646.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, path +from system_tests import CaseMeta class Fix646_NikonAF22(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_841.py b/tests/bugfixes/github/test_issue_841.py index 14ba1430f4..3106d8da94 100644 --- a/tests/bugfixes/github/test_issue_841.py +++ b/tests/bugfixes/github/test_issue_841.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class InvalidDataLocationInCiffComponentDoRead(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_g44w_q3vm_gwjq.py b/tests/bugfixes/github/test_issue_g44w_q3vm_gwjq.py index cf17b65d5d..9401083621 100644 --- a/tests/bugfixes/github/test_issue_g44w_q3vm_gwjq.py +++ b/tests/bugfixes/github/test_issue_g44w_q3vm_gwjq.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors import unittest @unittest.skip("Skipping test using option -pR (only for Debug mode)") diff --git a/tests/bugfixes/github/test_issue_ghsa_583f_w9pm_99r2.py b/tests/bugfixes/github/test_issue_ghsa_583f_w9pm_99r2.py index 71a975cf3f..c5797771da 100644 --- a/tests/bugfixes/github/test_issue_ghsa_583f_w9pm_99r2.py +++ b/tests/bugfixes/github/test_issue_ghsa_583f_w9pm_99r2.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class Jp2ImagePrintStructureICC(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_ghsa_crmj_qh74_2r36.py b/tests/bugfixes/github/test_issue_ghsa_crmj_qh74_2r36.py index 704e624e93..79097c782f 100644 --- a/tests/bugfixes/github/test_issue_ghsa_crmj_qh74_2r36.py +++ b/tests/bugfixes/github/test_issue_ghsa_crmj_qh74_2r36.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class QuickTimeVideoNikonTagsDecoderOutOfBoundsRead(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_ghsa_g9xm_7538_mq8w.py b/tests/bugfixes/github/test_issue_ghsa_g9xm_7538_mq8w.py index 2ff1d4ecc5..6770ce2248 100644 --- a/tests/bugfixes/github/test_issue_ghsa_g9xm_7538_mq8w.py +++ b/tests/bugfixes/github/test_issue_ghsa_g9xm_7538_mq8w.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors class QuickTimeVideoNikonTagsDecoderOutOfBoundsRead(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_ghsa_h9x9_4f77_336w.py b/tests/bugfixes/github/test_issue_ghsa_h9x9_4f77_336w.py index d8c01d201b..101ef34d22 100644 --- a/tests/bugfixes/github/test_issue_ghsa_h9x9_4f77_336w.py +++ b/tests/bugfixes/github/test_issue_ghsa_h9x9_4f77_336w.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors class Jp2ImageEncodeJp2HeaderOutOfBoundsRead2(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_ghsa_m479_7frc_gqqg.py b/tests/bugfixes/github/test_issue_ghsa_m479_7frc_gqqg.py index 204bd31bd7..a719b25506 100644 --- a/tests/bugfixes/github/test_issue_ghsa_m479_7frc_gqqg.py +++ b/tests/bugfixes/github/test_issue_ghsa_m479_7frc_gqqg.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class ImagePrintIFDStructure(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_issue_ghsa_mxw9_qx4c_6m8v.py b/tests/bugfixes/github/test_issue_ghsa_mxw9_qx4c_6m8v.py index 76e16eca65..f750dc1414 100644 --- a/tests/bugfixes/github/test_issue_ghsa_mxw9_qx4c_6m8v.py +++ b/tests/bugfixes/github/test_issue_ghsa_mxw9_qx4c_6m8v.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, CopyTmpFiles, path @CopyTmpFiles("$data_path/issue_ghsa_mxw9_qx4c_6m8v_poc.jp2") class Jp2ImageEncodeJp2HeaderOutOfBoundsRead2(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_issue_ghsa_v5g7_46xf_h728.py b/tests/bugfixes/github/test_issue_ghsa_v5g7_46xf_h728.py index b65a58e347..c1efd73532 100644 --- a/tests/bugfixes/github/test_issue_ghsa_v5g7_46xf_h728.py +++ b/tests/bugfixes/github/test_issue_ghsa_v5g7_46xf_h728.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class Jp2ImageEncodeJp2HeaderOutOfBoundsRead2(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_pr_1979.py b/tests/bugfixes/github/test_pr_1979.py index fae3e21942..6f97974574 100644 --- a/tests/bugfixes/github/test_pr_1979.py +++ b/tests/bugfixes/github/test_pr_1979.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- -import system_tests -from system_tests import CaseMeta, path, CopyTmpFiles, check_no_ASAN_UBSAN_errors +from system_tests import CaseMeta, path class TestExiv2ExtractThumbnailToStdout(metaclass=CaseMeta): """ diff --git a/tests/bugfixes/github/test_pr_1994.py b/tests/bugfixes/github/test_pr_1994.py index 4a6c7ff134..2d4905a4b6 100644 --- a/tests/bugfixes/github/test_pr_1994.py +++ b/tests/bugfixes/github/test_pr_1994.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import system_tests from system_tests import CaseMeta, path class TestAddModelsForNikonFl3(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_pr_1999.py b/tests/bugfixes/github/test_pr_1999.py index ef6e4b6492..0a32663be4 100644 --- a/tests/bugfixes/github/test_pr_1999.py +++ b/tests/bugfixes/github/test_pr_1999.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import system_tests from system_tests import CaseMeta, path class TestXmpDateTimeSetting(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_pr_2000.py b/tests/bugfixes/github/test_pr_2000.py index e77191cef6..8de1931872 100644 --- a/tests/bugfixes/github/test_pr_2000.py +++ b/tests/bugfixes/github/test_pr_2000.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import system_tests from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors class TestVerboseExtractXmpSidecarToStdout(metaclass=CaseMeta): diff --git a/tests/bugfixes/github/test_pr_2068.py b/tests/bugfixes/github/test_pr_2068.py index d25c1860b9..0affc954b6 100644 --- a/tests/bugfixes/github/test_pr_2068.py +++ b/tests/bugfixes/github/test_pr_2068.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import system_tests from system_tests import CaseMeta, path class TestVerboseExtractStdoutMultiFile(metaclass=CaseMeta): diff --git a/tests/lens_tests/test_canon_lenses.py b/tests/lens_tests/test_canon_lenses.py index a67597bd3d..ba41acbfb3 100644 --- a/tests/lens_tests/test_canon_lenses.py +++ b/tests/lens_tests/test_canon_lenses.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import re import os import system_tests from lens_tests.utils import extract_lenses_from_cpp, make_test_cases, aperture_to_raw_exif diff --git a/tests/lens_tests/test_config_file.py b/tests/lens_tests/test_config_file.py index 14b3c41745..b20903978e 100644 --- a/tests/lens_tests/test_config_file.py +++ b/tests/lens_tests/test_config_file.py @@ -1,8 +1,6 @@ -import unittest import system_tests import os import shutil -import sys # copy the example config file into current working directory diff --git a/tests/lens_tests/utils.py b/tests/lens_tests/utils.py index 99bfac0be4..0780dc7bfb 100644 --- a/tests/lens_tests/utils.py +++ b/tests/lens_tests/utils.py @@ -1,5 +1,4 @@ import re -import os import logging import math from itertools import groupby @@ -153,7 +152,7 @@ def make_test_cases(lenses): **lens["meta"], "id": lens["id"], "desc": lens["desc"], - "target": " *OR* ".join([l["desc"] for l in lens_group if lens_is_match(lens["meta"], l["meta"])]), + "target": " *OR* ".join([lg["desc"] for lg in lens_group if lens_is_match(lens["meta"], lg["meta"])]), } for lens in lens_group ] diff --git a/tests/system_tests.py b/tests/system_tests.py index d3b00f7913..494ce98dfb 100644 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -724,7 +724,7 @@ def _encode(self, data_in, encode_action, get_err): """ result = None for encoding in self.encodings: - if encoding == bytes: + if encoding is bytes: return data_in try: result = encode_action(data_in, encoding)