From: John Mulligan Date: Wed, 22 Feb 2023 18:57:21 +0000 (-0500) Subject: cephadm: disable coverage for some compatibility blocks X-Git-Tag: v18.1.0~130^2~34 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90a475cea1b994ae971dba1c6bae8f9cdad016c4;p=ceph.git cephadm: disable coverage for some compatibility blocks This change disables reporting missing coverage for blocks that contain copy and pasted code from other python versions and exist to make those functions available to older python versions. Signed-off-by: John Mulligan (cherry picked from commit 2a8316b1c7440f7239cd74470b26bad6a50f9a2c) --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 2280cd692b7..bbdc38ba224 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1700,7 +1700,9 @@ class CallVerbosity(Enum): return _verbosity_level_to_log_level[self] # type: ignore -if sys.version_info < (3, 8): +# disable coverage for the next block. this is copy-n-paste +# from other code for compatibilty on older python versions +if sys.version_info < (3, 8): # pragma: no cover import itertools import threading import warnings @@ -1805,7 +1807,9 @@ if sys.version_info < (3, 8): try: from asyncio import run as async_run # type: ignore[attr-defined] -except ImportError: +except ImportError: # pragma: no cover + # disable coverage for this block. it should be a copy-n-paste from + # from newer libs for compatibilty on older python versions def async_run(coro): # type: ignore loop = asyncio.new_event_loop() try: