[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/22] qemu-iotests: Simplify FilePath __init__
From: |
Max Reitz |
Subject: |
[PULL 05/22] qemu-iotests: Simplify FilePath __init__ |
Date: |
Tue, 15 Sep 2020 12:46:10 +0200 |
From: Nir Soffer <nirsof@gmail.com>
Use list comprehension instead of append loop.
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200828232152.205833-6-nsoffer@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/iotests.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1799338f8b..91e4a57126 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -470,9 +470,8 @@ class FilePath:
"""
def __init__(self, *names, base_dir=test_dir):
- self.paths = []
- for name in names:
- self.paths.append(os.path.join(base_dir, file_pattern(name)))
+ self.paths = [os.path.join(base_dir, file_pattern(name))
+ for name in names]
def __enter__(self):
if len(self.paths) == 1:
--
2.26.2
- [PULL 00/22] Block patches, Max Reitz, 2020/09/15
- [PULL 01/22] qemu-iotests: Fix FilePaths cleanup, Max Reitz, 2020/09/15
- [PULL 02/22] qemu-iotests: Fix FilePaths docstring, Max Reitz, 2020/09/15
- [PULL 03/22] qemu-iotests: Support varargs syntax in FilePaths, Max Reitz, 2020/09/15
- [PULL 04/22] qemu-iotests: Merge FilePaths and FilePath, Max Reitz, 2020/09/15
- [PULL 05/22] qemu-iotests: Simplify FilePath __init__,
Max Reitz <=
- [PULL 07/22] qemu-img: avoid unaligned read requests during convert, Max Reitz, 2020/09/15
- [PULL 06/22] block/quorum.c: stable children names, Max Reitz, 2020/09/15
- [PULL 08/22] qcow2: Use macros for the L1, refcount and bitmap table entry sizes, Max Reitz, 2020/09/15
- [PULL 09/22] qcow2: Fix removal of list members from BDRVQcow2State.cluster_allocs, Max Reitz, 2020/09/15
- [PULL 11/22] qcow2: Rewrite the documentation of qcow2_alloc_cluster_offset(), Max Reitz, 2020/09/15
- [PULL 10/22] qcow2: Don't check nb_clusters when removing l2meta from the list, Max Reitz, 2020/09/15
- [PULL 13/22] iotests: Skip test_stream_parallel in test 030 when doing "make check", Max Reitz, 2020/09/15
- [PULL 14/22] block/vhdx: Support vhdx image only with 512 bytes logical sector size, Max Reitz, 2020/09/15
- [PULL 12/22] qemu-img: Explicit number replaced by a constant, Max Reitz, 2020/09/15
- [PULL 17/22] qcow2: Return the original error code in qcow2_co_pwrite_zeroes(), Max Reitz, 2020/09/15