Files
dlt/tests/hub/test_plugin_import.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

37 lines
906 B
Python

import pytest
from pytest_console_scripts import ScriptRunner
from tests.workspace.utils import isolated_workspace
def test_import_props() -> None:
import dlt.hub
# hub plugin found
assert dlt.hub.__found__
assert len(dlt.hub.__all__) > 0
# no exception
assert dlt.hub.__exception__ is None
# regular attribute error raised
with pytest.raises(AttributeError) as attr_err:
dlt.hub._unknown_feature
assert "_unknown_feature" in str(attr_err.value)
def test_runtime_client_imports(script_runner: ScriptRunner) -> None:
pytest.importorskip("dlt_runtime")
import dlt_runtime # type: ignore[import-untyped,import-not-found,unused-ignore]
print(dlt_runtime.__version__)
# check command activation
with isolated_workspace("pipelines"):
result = script_runner.run(["dlt", "runtime", "-h"])
assert result.returncode == 0