mirror of
https://github.com/dlt-hub/dlt.git
synced 2025-12-17 19:31:30 +00:00
* 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
23 lines
690 B
Python
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]"
|