From: John Mulligan Date: Wed, 22 Feb 2023 18:57:21 +0000 (-0500) Subject: cephadm: disable coverage for some compatibility blocks X-Git-Tag: v19.0.0~1614^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2a8316b1c7440f7239cd74470b26bad6a50f9a2c;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 --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index b3d0c1621db..cc925d3ee23 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: