Skip to main content

Pytest plugin to run unit tests for dbx (Databricks CLI extensions) related code

Project description

pytest-dbx

Pytest plugin for testing dbx-based projects.

Install

To use the fixtures in your project, simply add pytest-dbx to your project's dev-dependencies (where you would place all your test and build dependencies).

Fixtures

In unit tests you can use the dbx_spark fixture to have a spark session available as in Databricks

def test_function(dbx_spark):
    sdf = dbx_spark.createDataFrame([[1], [2], [3]], ['a'])
    assert sdf.count() == 3

The dbutils_fixture and mlflow_local are automatically used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_dbx-0.1.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

pytest_dbx-0.1.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page