def is_coverage_running():
 if ('coverage' not in sys.modules):
  return False
 tracer = sys.gettrace()
 if (tracer is None):
  return False
 try:
  mod = tracer.__module__
 except AttributeError:
  try:
   mod = tracer.__class__.__module__
  except AttributeError:
   return False
 return mod.startswith('coverage')

def is_coverage_running ( ) : if ( 'coverage' not in sys . modules ) : return False tracer = sys . gettrace ( ) if ( tracer is None ) : return False try : mod = tracer . __module__ except AttributeError : try : mod = tracer . __class__ . __module__ except AttributeError : return False return mod . startswith ( 'coverage' )
return whether coverage is currently running .