diff options
| author | Stefan Hajnoczi | 2017-08-24 09:22:01 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2017-09-05 11:32:07 +0200 |
| commit | f4844ac0adabc458ba4610a71155448783d37c73 (patch) | |
| tree | 0ec001714e54cb687cc49e3b98f01b40617ca222 /scripts | |
| parent | qemu.py: make VM() a context manager (diff) | |
| download | qemu-f4844ac0adabc458ba4610a71155448783d37c73.tar.gz qemu-f4844ac0adabc458ba4610a71155448783d37c73.tar.xz qemu-f4844ac0adabc458ba4610a71155448783d37c73.zip | |
iotests.py: add FilePath context manager
The scratch/ (TEST_DIR) directory is not automatically cleaned up after
test execution. It is the responsibility of tests to remove any files
they create.
A nice way of doing this is to declare files at the beginning of the
test and automatically remove them with a context manager:
with iotests.FilePath('test.img') as img_path:
qemu_img(...)
qemu_io(...)
# img_path is guaranteed to be deleted here
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170824072202.26818-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
