1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
import logging
logger = logging.getLogger(__name__)
def is_pymsalruntime_installed() -> bool:
try:
import pymsalruntime
logger.info("PyMsalRuntime installed and initialized")
return True
except ImportError:
logger.info("PyMsalRuntime not installed")
return False
except RuntimeError:
logger.warning(
"PyMsalRuntime installed but failed to initialize the real broker. "
"This may happen on Mac and Linux where broker is not built-in. "
"Test cases shall attempt broker and test its fallback behavior."
)
return True
|