From: Nir Soffer <nsoffer@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Nir Soffer <nirsof@gmail.com>,
qemu-block <qemu-block@nongnu.org>, John Snow <jsnow@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2 2/5] qemu-iotests: Fix FilePaths docstring
Date: Tue, 25 Aug 2020 14:17:33 +0300 [thread overview]
Message-ID: <CAMRbyyui2n_VZs1QyFABGcQ0xaT+kUE_C+G_3ihYrNcQuotYCg@mail.gmail.com> (raw)
In-Reply-To: <23efdc31-9715-ab6d-5a84-4ab412b4ed7b@redhat.com>
On Tue, Aug 25, 2020 at 1:48 PM Max Reitz <mreitz@redhat.com> wrote:
>
> On 21.08.20 01:54, Nir Soffer wrote:
> > When this class was extracted from FilePath, the docstring was not
> > updated for generating multiple files, and the example usage was
> > referencing unrelated file.
> >
> > Fixes: de263986b5dc
> > Signed-off-by: Nir Soffer <nsoffer@redhat.com>
> > ---
> > tests/qemu-iotests/iotests.py | 14 ++++++++------
> > 1 file changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> > index 16a04df8a3..f34a1d7ef1 100644
> > --- a/tests/qemu-iotests/iotests.py
> > +++ b/tests/qemu-iotests/iotests.py
> > @@ -450,14 +450,16 @@ def file_pattern(name):
> >
> > class FilePaths:
> > """
> > - FilePaths is an auto-generated filename that cleans itself up.
> > + Context manager generating multiple file names. The generated files are
> > + removed when exiting the context.
> >
> > - Use this context manager to generate filenames and ensure that the file
> > - gets deleted::
> > + Example usage:
> > +
> > + with FilePaths(['test.img', 'test.sock']) as (img_path, sock_path):
>
> On second thought, this isn’t a great example because image files and
> sockets should go into different base directories.
Right, will improve it in v3.
>
> Max
>
> > + # Use img_path and sock_path here...
> > +
> > + # img_path and sock_path are automatically removed here.
> >
> > - with FilePaths(['test.img']) as img_path:
> > - qemu_img('create', img_path, '1G')
> > - # migration_sock_path is automatically deleted
> > """
> > def __init__(self, names, base_dir=test_dir):
> > self.paths = []
> >
>
>
next prev parent reply other threads:[~2020-08-25 11:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 23:54 [PATCH v2 0/5] iotest.FilePath fixes and cleanups Nir Soffer
2020-08-20 23:54 ` [PATCH v2 1/5] qemu-iotests: Fix FilePaths cleanup Nir Soffer
2020-08-25 10:27 ` Max Reitz
2020-08-20 23:54 ` [PATCH v2 2/5] qemu-iotests: Fix FilePaths docstring Nir Soffer
2020-08-25 10:39 ` Max Reitz
2020-08-25 10:48 ` Max Reitz
2020-08-25 11:17 ` Nir Soffer [this message]
2020-08-20 23:54 ` [PATCH v2 3/5] qemu-iotests: Support varargs syntax in FilePaths Nir Soffer
2020-08-25 10:48 ` Max Reitz
2020-08-20 23:54 ` [PATCH v2 4/5] qemu-iotests: Merge FilePaths and FilePath Nir Soffer
2020-08-25 10:57 ` Max Reitz
2020-08-20 23:54 ` [PATCH v2 5/5] qemu-iotests: Simplify FilePath __init__ Nir Soffer
2020-08-25 10:58 ` Max Reitz
2020-08-25 11:37 ` [PATCH v2 0/5] iotest.FilePath fixes and cleanups Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMRbyyui2n_VZs1QyFABGcQ0xaT+kUE_C+G_3ihYrNcQuotYCg@mail.gmail.com \
--to=nsoffer@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=nirsof@gmail.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).