make direnv # install direnv and its shell hook
direnv allow # load the extension-selected workspace and compute
make dev # create the Python 3.12 development environment
make test # build, install, and test the wheelEnvironment flow: VS Code extension → .databricks/.databricks.env → direnv
→ Make → pytest. Databricks Connect and the SDK therefore use the workspace and
compute selected in the extension. See Developer setup.
- Build and install the wheel with its dependencies.
- Run all files in
tests/. - Write
.junittest.xml,coverage/html/, andcoverage/xml/xml.xml.
Important options:
-n8: pytest-xdist runs eight workers.--exitfirst -vv: stop on failure and show every test.--cov=dbrdemo: pytest-cov reports coverage without enforcing a threshold.
- Databricks Labs pytester
provides reusable pytest helpers such as
make_random. - Databricks Labs Blueprint
provides the formatted logger enabled by
tests/conftest.py.
- Local tests cover docs, CLIs, and skill installation.
- Connected tests cover Spark, the SDK, Unity Catalog tables, volumes, and files.
temporary_schemacreates a random schema per test and always removes it.- Random names keep parallel xdist workers isolated.
The test identity needs permission to create schemas, tables, and volumes in the current catalog.
.venv/bin/pytest -n0 -vv tests/foobar_test.py::test_write_foobar