Files
2026-07-13 12:49:22 +08:00

17 lines
511 B
Python

import sys
import importlib
from unittest.mock import patch
def test_datalab_unavailable():
with patch.dict(sys.modules, {"cleanlab.datalab.datalab": ImportError("Mocked ImportError")}):
# Reload the module to trigger the import statement
import cleanlab
importlib.reload(cleanlab)
assert cleanlab.Datalab.message == (
"Datalab is not available due to missing dependencies. "
"To install Datalab, run `pip install 'cleanlab[datalab]'`."
)