From: John Mulligan Date: Fri, 1 Nov 2024 17:46:13 +0000 (-0400) Subject: python-common/tests: update some type annotations X-Git-Tag: v20.0.0~647^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bdf7d4f30c5caa0d862723c2dc998e456e92ec88;p=ceph.git python-common/tests: update some type annotations Update some function typing from the old comment based style to the current type annotations style. Not only does this modernize the code but it fixes issues found by newer versions of flake8 that were flagging types only referenced in type comments as unused imports. Part of an effort to get ceph tox environments passing on Python 3.12. Signed-off-by: John Mulligan --- diff --git a/src/python-common/ceph/tests/utils.py b/src/python-common/ceph/tests/utils.py index 04b8a4e3895..20a39e4666b 100644 --- a/src/python-common/ceph/tests/utils.py +++ b/src/python-common/ceph/tests/utils.py @@ -35,8 +35,7 @@ def _mk_device(rotational=True, )] -def _mk_inventory(devices): - # type: (Any) -> List[Device] +def _mk_inventory(devices: Any) -> List[Device]: devs = [] for dev_, name in zip(devices, map(chr, range(ord('a'), ord('z')))): dev = Device.from_json(dev_.to_json())