[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/69] iotests: Use case_skip() in skip_if_unsupported()
From: |
Max Reitz |
Subject: |
[PULL 03/69] iotests: Use case_skip() in skip_if_unsupported() |
Date: |
Mon, 28 Oct 2019 13:13:55 +0100 |
skip_if_unsupported() should use the stronger variant case_skip(),
because this allows it to be used even with setUp() (in a meaningful
way).
In the process, make it explicit what we expect the first argument of
the func_wrapper to be (namely something derived of QMPTestCase).
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Andrey Shinkevich <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/iotests.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 6d5de6e504..bd867d7e02 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -929,14 +929,14 @@ def skip_if_unsupported(required_formats=[],
read_only=False):
'''Skip Test Decorator
Runs the test if all the required formats are whitelisted'''
def skip_test_decorator(func):
- def func_wrapper(*args, **kwargs):
+ def func_wrapper(test_case: QMPTestCase, *args, **kwargs):
usf_list = list(set(required_formats) -
set(supported_formats(read_only)))
if usf_list:
- case_notrun('{}: formats {} are not whitelisted'.format(
- args[0], usf_list))
+ test_case.case_skip('{}: formats {} are not
whitelisted'.format(
+ test_case, usf_list))
else:
- return func(*args, **kwargs)
+ return func(test_case, *args, **kwargs)
return func_wrapper
return skip_test_decorator
--
2.21.0
- [PULL 00/69] Block patches for softfreeze, Max Reitz, 2019/10/28
- [PULL 01/69] iotests: Prefer null-co over null-aio, Max Reitz, 2019/10/28
- [PULL 02/69] iotests: Allow skipping test cases, Max Reitz, 2019/10/28
- [PULL 03/69] iotests: Use case_skip() in skip_if_unsupported(),
Max Reitz <=
- [PULL 06/69] iotests: Test driver whitelisting in 136, Max Reitz, 2019/10/28
- [PULL 04/69] iotests: Let skip_if_unsupported accept a function, Max Reitz, 2019/10/28
- [PULL 08/69] hbitmap: handle set/reset with zero length, Max Reitz, 2019/10/28
- [PULL 05/69] iotests: Test driver whitelisting in 093, Max Reitz, 2019/10/28
- [PULL 07/69] iotests: Cache supported_formats(), Max Reitz, 2019/10/28
- [PULL 09/69] block/mirror: simplify do_sync_target_write, Max Reitz, 2019/10/28
- [PULL 10/69] block/block-backend: add blk_co_pwritev_part, Max Reitz, 2019/10/28
- [PULL 11/69] block/mirror: support unaligned write in active mirror, Max Reitz, 2019/10/28
- [PULL 12/69] Revert "mirror: Only mirror granularity-aligned chunks", Max Reitz, 2019/10/28
- [PULL 13/69] iotests: Introduce $SOCK_DIR, Max Reitz, 2019/10/28