]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: disable coverage for some compatibility blocks
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 22 Feb 2023 18:57:21 +0000 (13:57 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 6 Mar 2023 15:42:34 +0000 (10:42 -0500)
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 <jmulligan@redhat.com>
src/cephadm/cephadm.py

index b3d0c1621db55f9c07f3e20edeb4e5e251357b65..cc925d3ee23a0cadd8750a2a369d6a665cad70a0 100755 (executable)
@@ -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: