diff --git a/tests/bugfixes/github/test_CVE_2017_1000126.py b/tests/bugfixes/github/test_CVE_2017_1000126.py index d90530750f..9cfa17a5c2 100644 --- a/tests/bugfixes/github/test_CVE_2017_1000126.py +++ b/tests/bugfixes/github/test_CVE_2017_1000126.py @@ -7,7 +7,7 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/175" filename = "$data_path/cve_2017_1000126_stack-oob-read.webp" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ f"""$exiv2_exception_message {filename}: diff --git a/tests/bugfixes/github/test_CVE_2017_14859.py b/tests/bugfixes/github/test_CVE_2017_14859.py index 78f47934dd..2de675461b 100644 --- a/tests/bugfixes/github/test_CVE_2017_14859.py +++ b/tests/bugfixes/github/test_CVE_2017_14859.py @@ -10,15 +10,13 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + ":\n" - + ( - "$kerFailedToReadImageData" - if system_tests.BT.Config.is_64bit - else "$kerCorruptedMetadata" - ) - + "\n" + f"""$exiv2_exception_message {filename}: +{( + "$kerFailedToReadImageData" + if system_tests.BT.Config.is_64bit + else "$kerCorruptedMetadata" +)} +""" ] retval = [1] diff --git a/tests/bugfixes/github/test_CVE_2017_14860.py b/tests/bugfixes/github/test_CVE_2017_14860.py index 90876de208..8c284f2d31 100644 --- a/tests/bugfixes/github/test_CVE_2017_14860.py +++ b/tests/bugfixes/github/test_CVE_2017_14860.py @@ -7,12 +7,10 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/73" filename = "$data_path/003-heap-buffer-over" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_CVE_2017_14862.py b/tests/bugfixes/github/test_CVE_2017_14862.py index 07328fe9bd..490641c410 100644 --- a/tests/bugfixes/github/test_CVE_2017_14862.py +++ b/tests/bugfixes/github/test_CVE_2017_14862.py @@ -8,16 +8,14 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/75" filename = "$data_path/008-invalid-mem" - commands = ["$exiv2 -q " + filename] + commands = [f"$exiv2 -q {filename}"] if system_tests.BT.Config.is_64bit: stderr = [""] retval = [0] else: stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_CVE_2017_14864.py b/tests/bugfixes/github/test_CVE_2017_14864.py index 7e27582f20..a17f853707 100644 --- a/tests/bugfixes/github/test_CVE_2017_14864.py +++ b/tests/bugfixes/github/test_CVE_2017_14864.py @@ -10,14 +10,12 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): commands = [f"$exiv2 -q {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + ":\n" - + ( - "$kerFailedToReadImageData" - if system_tests.BT.Config.is_64bit - else "$kerCorruptedMetadata" - ) - + "\n" + f"""$exiv2_exception_message {filename}: +{( + "$kerFailedToReadImageData" + if system_tests.BT.Config.is_64bit + else "$kerCorruptedMetadata" +)} +""" ] retval = [1] diff --git a/tests/bugfixes/github/test_CVE_2017_17669.py b/tests/bugfixes/github/test_CVE_2017_17669.py index 060fc7c98e..ba396d63d1 100644 --- a/tests/bugfixes/github/test_CVE_2017_17669.py +++ b/tests/bugfixes/github/test_CVE_2017_17669.py @@ -7,13 +7,11 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/187" filename = "$data_path/issue_187" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] retval = [1] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerFailedToReadImageData """ ] diff --git a/tests/bugfixes/github/test_CVE_2017_17722.py b/tests/bugfixes/github/test_CVE_2017_17722.py index fd9f795c29..1180678d74 100644 --- a/tests/bugfixes/github/test_CVE_2017_17722.py +++ b/tests/bugfixes/github/test_CVE_2017_17722.py @@ -7,13 +7,11 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/208" filename = "$data_path/2018-01-09-exiv2-crash-001.tiff" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] retval = [1] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: -$filename: $kerFileContainsUnknownImageType + f"""$exiv2_exception_message {filename}: +{filename}: $kerFileContainsUnknownImageType """ ] diff --git a/tests/bugfixes/github/test_CVE_2017_17725.py b/tests/bugfixes/github/test_CVE_2017_17725.py index 95631afbe8..72c2b861e8 100644 --- a/tests/bugfixes/github/test_CVE_2017_17725.py +++ b/tests/bugfixes/github/test_CVE_2017_17725.py @@ -8,12 +8,10 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): found_by = ["Wei You", "@youwei1988"] filename = "$data_path/poc_2017-12-12_issue188" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_CVE_2017_18005.py b/tests/bugfixes/github/test_CVE_2017_18005.py index 88ec6f90be..a716880de5 100644 --- a/tests/bugfixes/github/test_CVE_2017_18005.py +++ b/tests/bugfixes/github/test_CVE_2017_18005.py @@ -20,9 +20,7 @@ class TestPoC(metaclass=system_tests.CaseMeta): commands = [f"$exiv2 -vPEIXxgklnycsvth -b {filename}"] stdout = [ - """File 1/1: """ - + filename - + """ + f"""File 1/1: {filename} 0x0117 Image Exif.Image.StripByteCounts StripByteCounts Strip Byte Count SByte 0 0 """ diff --git a/tests/bugfixes/github/test_CVE_2018_10999.py b/tests/bugfixes/github/test_CVE_2018_10999.py index d89988a0b4..99c1bda7ec 100644 --- a/tests/bugfixes/github/test_CVE_2018_10999.py +++ b/tests/bugfixes/github/test_CVE_2018_10999.py @@ -7,13 +7,11 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/306" filename = "$data_path/pocIssue306" - commands = ["$exiv2 -et " + filename] + commands = [f"$exiv2 -et {filename}"] retval = [1] stdout = [""] stderr = [ - """$exception_in_extract """ - + filename - + """: + f"""$exception_in_extract {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_CVE_2018_4868.py b/tests/bugfixes/github/test_CVE_2018_4868.py index 6f11cabbe0..cf1534c87b 100644 --- a/tests/bugfixes/github/test_CVE_2018_4868.py +++ b/tests/bugfixes/github/test_CVE_2018_4868.py @@ -9,12 +9,10 @@ class TestCvePoC(metaclass=system_tests.CaseMeta): found_by = ["afl", "topsecLab", "xcainiao"] filename = "$data_path/exiv2-memorymmap-error" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_issue_1011.py b/tests/bugfixes/github/test_issue_1011.py index 6cf2635020..3285732794 100644 --- a/tests/bugfixes/github/test_issue_1011.py +++ b/tests/bugfixes/github/test_issue_1011.py @@ -5,12 +5,10 @@ class Test_issue_1011(metaclass=CaseMeta): filename = path("$data_path/Jp2Image_readMetadata_loop.poc") - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_issue_170.py b/tests/bugfixes/github/test_issue_170.py index 324ac3d28f..74c3ca24c4 100644 --- a/tests/bugfixes/github/test_issue_170.py +++ b/tests/bugfixes/github/test_issue_170.py @@ -8,12 +8,10 @@ class DecodeIHDRChunkOutOfBoundsRead(metaclass=system_tests.CaseMeta): filename = "$data_path/issue_170_poc" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerFailedToReadImageData """ ] diff --git a/tests/bugfixes/github/test_issue_1833.py b/tests/bugfixes/github/test_issue_1833.py index bd5099492b..f55596a659 100644 --- a/tests/bugfixes/github/test_issue_1833.py +++ b/tests/bugfixes/github/test_issue_1833.py @@ -12,11 +12,9 @@ class TiffMnEntryDoCountInvalidTiffType(metaclass=CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/1833" filename = path("$data_path/issue_1833_poc.jpg") - commands = ["$exiv2 -pS $filename"] + commands = [f"$exiv2 -pS {filename}"] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerFailedToReadImageData """ ] diff --git a/tests/bugfixes/github/test_issue_1845.py b/tests/bugfixes/github/test_issue_1845.py index 30d23ef611..84a02b6c11 100644 --- a/tests/bugfixes/github/test_issue_1845.py +++ b/tests/bugfixes/github/test_issue_1845.py @@ -15,9 +15,7 @@ class TiffDirectoryWriteDirEntryAssert(metaclass=CaseMeta): filename = path("$tmp_path/issue_1845_poc.jp2") commands = ["$exiv2 -q -D +1 ad $filename"] stderr = [ - """$exception_in_adjust """ - + filename - + """: + f"""$exception_in_adjust {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_issue_1881.py b/tests/bugfixes/github/test_issue_1881.py index 748451a1f5..5a0dff2126 100644 --- a/tests/bugfixes/github/test_issue_1881.py +++ b/tests/bugfixes/github/test_issue_1881.py @@ -16,9 +16,7 @@ class SonyPreviewImageLargeAllocation(metaclass=CaseMeta): filename2 = path("$tmp_path/issue_1881_coverage.jpg") commands = ["$exiv2 -q -d I rm $filename1", "$exiv2 -q -d I rm $filename2"] stderr = [ - """$exception_in_erase """ - + filename1 - + """: + f"""$exception_in_erase {filename1}: $kerFailedToReadImageData """, "", diff --git a/tests/bugfixes/github/test_issue_20.py b/tests/bugfixes/github/test_issue_20.py index 6e98b5fdd8..adfd82c0f5 100644 --- a/tests/bugfixes/github/test_issue_20.py +++ b/tests/bugfixes/github/test_issue_20.py @@ -13,12 +13,10 @@ class TamronSupport(metaclass=system_tests.CaseMeta): "TamronSP90mmF2.8DiVCUSDMacroF004.exv", "TamronSP90mmF2.8DiVCUSDMacroF017.exv", ] - commands = [f"$exiv2 -pa --grep lens/i ../../../test/data/{files[0]}"] + list( - map( - lambda fname: f"$exiv2 -pa --grep lenstype/i ../../../test/data/{fname}", - files[1:], - ) - ) + commands = [f"$exiv2 -pa --grep lens/i ../../../test/data/{files[0]}"] + [ + f"$exiv2 -pa --grep lenstype/i ../../../test/data/{fname}" + for fname in files[1:] + ] retval = [0] * len(files) stdout = [ diff --git a/tests/bugfixes/github/test_issue_227.py b/tests/bugfixes/github/test_issue_227.py index 2a557c3a76..65e4b6fb93 100644 --- a/tests/bugfixes/github/test_issue_227.py +++ b/tests/bugfixes/github/test_issue_227.py @@ -10,9 +10,7 @@ class SigmaLenses(metaclass=system_tests.CaseMeta): "Sigma_50mm_F1.4_DG_HSM_A.exv", ] - commands = list( - map(lambda fname: f"$exiv2 -pa --grep lens/i $data_path/{fname}", files) - ) + commands = [f"$exiv2 -pa --grep lens/i $data_path/{fname}" for fname in files] retval = 3 * [0] stderr = 3 * [""] diff --git a/tests/bugfixes/github/test_issue_2270.py b/tests/bugfixes/github/test_issue_2270.py index cc71aa7bd8..32106a696c 100644 --- a/tests/bugfixes/github/test_issue_2270.py +++ b/tests/bugfixes/github/test_issue_2270.py @@ -16,9 +16,7 @@ class WebPImage_inject_VP8X_integer_overflow(metaclass=CaseMeta): commands = ["$exiv2 rm $filename"] stdout = [""] stderr = [ - """$exception_in_erase """ - + filename - + """: + f"""$exception_in_erase {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_issue_246.py b/tests/bugfixes/github/test_issue_246.py index 855dcc7f36..50d78fe621 100644 --- a/tests/bugfixes/github/test_issue_246.py +++ b/tests/bugfixes/github/test_issue_246.py @@ -12,11 +12,9 @@ class TestFirstPoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/246" filename = "$data_path/1-string-format.jpg" - commands = ["$exiv2 -pS " + filename] + commands = [f"$exiv2 -pS {filename}"] stdout = [ - """STRUCTURE OF JPEG FILE: """ - + filename - + """ + f"""STRUCTURE OF JPEG FILE: {filename} address | marker | length | data 0 | 0xffd8 SOI 2 | 0xffe1 APP1 | 60 | Exif..II*.....0.i...........0000 @@ -24,9 +22,7 @@ class TestFirstPoC(metaclass=system_tests.CaseMeta): ] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerNoImageInInputData """ ] diff --git a/tests/bugfixes/github/test_issue_253.py b/tests/bugfixes/github/test_issue_253.py index 04a5c74dae..76bc0b1e79 100644 --- a/tests/bugfixes/github/test_issue_253.py +++ b/tests/bugfixes/github/test_issue_253.py @@ -12,12 +12,10 @@ class TestFirstPoC(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/253" filename = "$data_path/3-stringformat-outofbound-read" - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerNotAJpeg """ ] diff --git a/tests/bugfixes/github/test_issue_400.py b/tests/bugfixes/github/test_issue_400.py index aa96843adb..61ca7fae0f 100644 --- a/tests/bugfixes/github/test_issue_400.py +++ b/tests/bugfixes/github/test_issue_400.py @@ -8,12 +8,10 @@ class parseTXTChunkOutOfBoundsRead(metaclass=system_tests.CaseMeta): filenames = [system_tests.path("$data_path/issue_400_poc" + str(i)) for i in (1, 2)] - commands = ["$exiv2 " + fname for fname in filenames] + commands = [f"$exiv2 {fname}" for fname in filenames] stdout = [""] * 2 stderr = [ - """$exiv2_exception_message """ - + fname - + """: + f"""$exiv2_exception_message {fname}: $kerCorruptedMetadata """ for fname in filenames diff --git a/tests/bugfixes/github/test_issue_426.py b/tests/bugfixes/github/test_issue_426.py index 91d97b1655..0de688b909 100644 --- a/tests/bugfixes/github/test_issue_426.py +++ b/tests/bugfixes/github/test_issue_426.py @@ -7,12 +7,10 @@ class DetectsWrongLengthOfImageResourceInPSDFile(metaclass=system_tests.CaseMeta url = "https://github.com/Exiv2/exiv2/issues/426" filename = system_tests.path("$data_path/h02.psd") - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] retval = [1] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_issue_428.py b/tests/bugfixes/github/test_issue_428.py index 38eebbd305..12d59f8e97 100644 --- a/tests/bugfixes/github/test_issue_428.py +++ b/tests/bugfixes/github/test_issue_428.py @@ -4,13 +4,9 @@ def stderr_exception(fname): - return ( - """$exiv2_exception_message """ - + fname - + """: + return f"""$exiv2_exception_message {fname}: $kerFailedToReadImageData """ - ) class PngReadRawProfile(metaclass=system_tests.CaseMeta): @@ -27,14 +23,12 @@ class PngReadRawProfile(metaclass=system_tests.CaseMeta): system_tests.path("$data_path/issue_428_poc6.png"), ] - commands = ["$exiv2 " + fname for fname in filenames] + commands = [f"$exiv2 {fname}" for fname in filenames] stdout = [""] * len(filenames) stderr = [stderr_exception(fname) for fname in filenames[0:6]] stderr.append( - """$exiv2_exception_message """ - + filenames[6] - + """: + f"""$exiv2_exception_message {filenames[6]}: $kerInputDataReadFailed """ ) diff --git a/tests/bugfixes/github/test_issue_460.py b/tests/bugfixes/github/test_issue_460.py index 69304311a9..dae295c61a 100644 --- a/tests/bugfixes/github/test_issue_460.py +++ b/tests/bugfixes/github/test_issue_460.py @@ -7,12 +7,10 @@ class ThrowsWhenCRWImageIsMalformed(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/460" filename = system_tests.path("$data_path/issue_460") - commands = ["$exiv2 " + filename] + commands = [f"$exiv2 {filename}"] retval = [1] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_issue_511.py b/tests/bugfixes/github/test_issue_511.py index 73665c1f73..daec78b9e6 100644 --- a/tests/bugfixes/github/test_issue_511.py +++ b/tests/bugfixes/github/test_issue_511.py @@ -9,18 +9,14 @@ class ThrowsWhenIFDsAreMalformed(metaclass=system_tests.CaseMeta): url = "https://github.com/Exiv2/exiv2/issues/511" filename = system_tests.path("$data_path/pocIssue511") - commands = ["$exiv2 -pR " + filename] + commands = [f"$exiv2 -pR {filename}"] retval = [1] stdout = [ - """STRUCTURE OF TIFF FILE (II): """ - + filename - + """ + f"""STRUCTURE OF TIFF FILE (II): {filename} """ ] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/github/test_issue_712.py b/tests/bugfixes/github/test_issue_712.py index 7c02d3f892..5e95334a5b 100644 --- a/tests/bugfixes/github/test_issue_712.py +++ b/tests/bugfixes/github/test_issue_712.py @@ -23,9 +23,7 @@ class BigTiffImageRecursionStackExhaustion(metaclass=system_tests.CaseMeta): commands = ["$exiv2 -b -u -k pr $filename"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $filename: $kerFileContainsUnknownImageType """ ] diff --git a/tests/bugfixes/github/test_issue_756.py b/tests/bugfixes/github/test_issue_756.py index 0094ce21f8..a1ed4f715d 100644 --- a/tests/bugfixes/github/test_issue_756.py +++ b/tests/bugfixes/github/test_issue_756.py @@ -7,9 +7,7 @@ class BufferOverReadInNikon1MakerNotePrint0x0088(metaclass=system_tests.CaseMeta filename = system_tests.path("$data_path/NikonMakerNotePrint0x088_overread") commands = ["$exiv2 -q -pt --grep AFFocusPos $filename"] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerFailedToReadImageData """ ] 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 baacf07768..8ee1a2d47e 100644 --- a/tests/bugfixes/github/test_issue_ghsa_583f_w9pm_99r2.py +++ b/tests/bugfixes/github/test_issue_ghsa_583f_w9pm_99r2.py @@ -15,9 +15,7 @@ class Jp2ImagePrintStructureICC(metaclass=CaseMeta): commands = ["$exiv2 -p C $filename"] stdout = [""] stderr = [ - """$exiv2_exception_message """ - + filename - + """: + f"""$exiv2_exception_message {filename}: $kerCorruptedMetadata """ ] 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 69a4cb7bd2..afdf9b05c2 100644 --- a/tests/bugfixes/github/test_issue_ghsa_mxw9_qx4c_6m8v.py +++ b/tests/bugfixes/github/test_issue_ghsa_mxw9_qx4c_6m8v.py @@ -16,9 +16,7 @@ class Jp2ImageEncodeJp2HeaderOutOfBoundsRead2(metaclass=CaseMeta): commands = ["$exiv2 rm $filename"] stdout = [""] stderr = [ - """$exception_in_erase """ - + filename - + """: + f"""$exception_in_erase {filename}: $kerCorruptedMetadata """ ] diff --git a/tests/bugfixes/redmine/test_issue_1179.py b/tests/bugfixes/redmine/test_issue_1179.py index cd83d0f1c9..0fc21646c2 100644 --- a/tests/bugfixes/redmine/test_issue_1179.py +++ b/tests/bugfixes/redmine/test_issue_1179.py @@ -19,8 +19,7 @@ class CheckFilmMode(metaclass=system_tests.CaseMeta): url = "http://dev.exiv2.org/issues/1179" - commands = list(itertools.chain.from_iterable( - make_command(fname) for fname in ORIGINAL_FILES)) + commands = [cmd for fname in ORIGINAL_FILES for cmd in make_command(fname)] stdout = [ """Exif.Fujifilm.Version Undefined 4 48 49 51 48 diff --git a/tests/bugfixes/redmine/test_issue_800.py b/tests/bugfixes/redmine/test_issue_800.py index 0f26197e63..1279427cc4 100644 --- a/tests/bugfixes/redmine/test_issue_800.py +++ b/tests/bugfixes/redmine/test_issue_800.py @@ -111,11 +111,7 @@ class MissingPhotoshopIrbTypes(metaclass=system_tests.CaseMeta): types = ["8BIM", "AgHg", "DCSR", "PHUT"] formats = ["jpg", "psd"] - commands = list( - itertools.chain.from_iterable( - make_commands(fname) for fname in FILES - ) - ) + commands = [cmd for fname in FILES for cmd in make_commands(fname)] stdout = list( itertools.chain.from_iterable( diff --git a/tests/bugfixes/redmine/test_issue_922.py b/tests/bugfixes/redmine/test_issue_922.py index af8a292b0a..db0b332ef4 100644 --- a/tests/bugfixes/redmine/test_issue_922.py +++ b/tests/bugfixes/redmine/test_issue_922.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import itertools import os.path from system_tests import CaseMeta, path @@ -31,12 +30,9 @@ class AddMinusPSOption(metaclass=CaseMeta): commands = [ "$exiv2 -pX $bug_jpg_file", "$exiv2 -pX $IPTC_file", - ] + list( - itertools.chain.from_iterable([ - f"$exiv2 -pX {fname}", - f"$exiv2 -pS {fname}" - ] for fname in files) - ) + ] + [ + cmd for fname in files for cmd in [f"$exiv2 -pX {fname}", f"$exiv2 -pS {fname}"] + ] stdout = [ read_file( diff --git a/tests/system_tests.py b/tests/system_tests.py index 925f4a9f5f..08b9f21a6b 100644 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -846,7 +846,7 @@ def __new__(mcs, clsname, bases, dct): # expand all non-private variables by brute force # => try all expanding all elements defined in the current class until # there is no change in them any more - keys = [key for key in list(dct.keys()) if not key.startswith('_')] + keys = [key for key in dct if not key.startswith('_')] while changed: changed = False