Files
dlt/tests/common/runtime/test_known_plugins.py
rudolfix 06bc05848b (chore) adds hub extra (#3428)
* adds hub extra

* makes hub module more user friendly when hub not installed

* test and lint fixes

* adds plugin version check util function

* adds dlt-runtime to hub extra, minimal import tests

* bumps to dlthub 0.20.0 alpha

* lists pipelines with cli using the same functions as dashboard, dlt pipeline will list pipelines by default

* adds configured propfiles method on context so only profiles with configs or pipelines are listed

* adds list of locations that contained actual configs to provider interface

* improves workspace and profile commands

* test fixes

* fixes tests
2025-12-05 16:15:19 +01:00

23 lines
690 B
Python

"""Tests behavior of know plugins when they are not installed"""
import pytest
from dlt.common.exceptions import MissingDependencyException
def test_hub_fallback() -> None:
import dlt.hub
if dlt.hub.__found__ or not isinstance(dlt.hub.__exception__, ModuleNotFoundError):
pytest.skip(
"Skip test due to hub being present or partially loaded: " + str(dlt.hub.__exception__)
)
assert isinstance(dlt.hub.__exception__, ModuleNotFoundError)
# accessing attributes generates import error
with pytest.raises(MissingDependencyException) as missing_ex:
dlt.hub.transformation
assert missing_ex.value.dependencies[0] == "dlt[hub]"