Message ID | 20200820235427.374645-6-nsoffer@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iotest.FilePath fixes and cleanups | expand |
On 21.08.20 01:54, Nir Soffer wrote: > Use list comprehension instead of append loop. > > Signed-off-by: Nir Soffer <nsoffer@redhat.com> > --- > tests/qemu-iotests/iotests.py | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Max Reitz <mreitz@redhat.com>
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 1b5cdd493e..7ebd0bcc92 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -467,9 +467,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:
Use list comprehension instead of append loop. Signed-off-by: Nir Soffer <nsoffer@redhat.com> --- tests/qemu-iotests/iotests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)