[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/51] iotests: Fix incomplete type declarations
From: |
Kevin Wolf |
Subject: |
[PULL 06/51] iotests: Fix incomplete type declarations |
Date: |
Fri, 15 May 2020 14:44:36 +0200 |
We need to fix only a few places so that iotests.py can pass
mypy --disallow-incomplete-defs, which seems to be a desirable option to
have enabled in the long run.
Signed-off-by: Kevin Wolf <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <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 6c0e781af7..1d7f6fd7cf 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1040,7 +1040,7 @@ def _verify_cache_mode(supported_cache_modes:
Sequence[str] = ()) -> None:
if supported_cache_modes and (cachemode not in supported_cache_modes):
notrun('not suitable for this cache mode: %s' % cachemode)
-def _verify_aio_mode(supported_aio_modes: Sequence[str] = ()):
+def _verify_aio_mode(supported_aio_modes: Sequence[str] = ()) -> None:
if supported_aio_modes and (aiomode not in supported_aio_modes):
notrun('not suitable for this aio mode: %s' % aiomode)
@@ -1087,7 +1087,8 @@ 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(test_case: QMPTestCase, *args, **kwargs):
+ def func_wrapper(test_case: QMPTestCase, *args: List[Any],
+ **kwargs: Dict[str, Any]) -> None:
if callable(required_formats):
fmts = required_formats(test_case)
else:
@@ -1097,9 +1098,8 @@ def skip_if_unsupported(required_formats=(),
read_only=False):
if usf_list:
msg = f'{test_case}: formats {usf_list} are not whitelisted'
test_case.case_skip(msg)
- return None
else:
- return func(test_case, *args, **kwargs)
+ func(test_case, *args, **kwargs)
return func_wrapper
return skip_test_decorator
--
2.25.4
- [PULL 00/51] Block layer patches, Kevin Wolf, 2020/05/15
- [PULL 02/51] iotests/229: Use blkdebug to inject an error, Kevin Wolf, 2020/05/15
- [PULL 01/51] iotests/109: Don't mirror with mismatched size, Kevin Wolf, 2020/05/15
- [PULL 03/51] mirror: Make sure that source and target size match, Kevin Wolf, 2020/05/15
- [PULL 05/51] block/replication.c: Avoid cancelling the job twice, Kevin Wolf, 2020/05/15
- [PULL 04/51] iotests: Mirror with different source/target size, Kevin Wolf, 2020/05/15
- [PULL 06/51] iotests: Fix incomplete type declarations,
Kevin Wolf <=
- [PULL 07/51] iotests: Run pylint and mypy in a testcase, Kevin Wolf, 2020/05/15
- [PULL 11/51] replication: Avoid blk_make_empty() on read-only child, Kevin Wolf, 2020/05/15
- [PULL 08/51] block: Add bdrv_make_empty(), Kevin Wolf, 2020/05/15
- [PULL 09/51] block: Add blk_make_empty(), Kevin Wolf, 2020/05/15
- [PULL 12/51] block: Use bdrv_make_empty() where possible, Kevin Wolf, 2020/05/15
- [PULL 10/51] block: Use blk_make_empty() after commits, Kevin Wolf, 2020/05/15
- [PULL 13/51] block: Mark commit, mirror, blkreplay as filters, Kevin Wolf, 2020/05/15
- [PULL 16/51] block: Add BdrvChildRole and BdrvChildRoleBits, Kevin Wolf, 2020/05/15
- [PULL 20/51] block: Pass parent_is_format to .inherit_options(), Kevin Wolf, 2020/05/15
- [PULL 21/51] block: Rename bdrv_inherited_options(), Kevin Wolf, 2020/05/15