The set of reusable tests and test fixtures used to test common functionality
Project description
dbt-tests-adapter
For context and guidance on using this package, please read: "Testing a new adapter"
What is it?
This package includes reusable test cases that reinforce behaviors common to all or many adapter plugins. There are two categories of tests:
-
Basic tests that every adapter plugin is expected to pass. These are defined in
tests.adapter.basic
. Given differences across data platforms, these may require slight modification or reimplementation. Significantly overriding or disabling these tests should be with good reason, since each represents basic functionality expected by dbt users. For example, if your adapter does not support incremental models, you should disable the test, by marking it withskip
orxfail
, as well as noting that limitation in any documentation, READMEs, and usage guides that accompany your adapter. -
Optional tests, for second-order functionality that is common across plugins, but not required for basic use. Your plugin can opt into these test cases by inheriting existing ones, or reimplementing them with adjustments. For now, this category includes all tests located outside the
basic
subdirectory. More tests will be added as we convert older tests defined on dbt-core and mature plugins to use the standard framework.
How to use it?
Each test case in this repo is packaged as a class, prefixed Base
. To enable a test case to run with your adapter plugin, you should inherit the base class into a new class, prefixed Test
. That test class will be discovered and run by pytest
. It can also makes modifications if needed.
class TestSimpleMaterializations(BaseSimpleMaterializations):
pass
Distribution
To install:
pip install dbt-tests-adapter
This package is versioned in lockstep with dbt-core
, and the same versioning guidelines apply:
- New "basic" test cases MAY be added in minor versions ONLY. They may not be included in patch releases.
- Breaking changes to existing test cases MAY be included and communicated as part of minor version upgrades ONLY. They MAY NOT be included in patch releases. We will aim to avoid these whenever possible.
- New "optional" test cases, and non-breaking fixes to existing test cases, MAY be added in minor or patch versions.
Assuming you adapter plugin is pinned to a specific minor version of dbt-core
(e.g. ~=1.1.0
), you can use the same pin for dbt-tests-adapter
.
Note: This is packaged as a plugin using a python namespace package. It cannot have an __init__.py
file in the part of the hierarchy to which it needs to be attached.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dbt_tests_adapter-1.10.3.tar.gz
.
File metadata
- Download URL: dbt_tests_adapter-1.10.3.tar.gz
- Upload date:
- Size: 152.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17e1c259fe9f89abcda5f8e3677a0d7055eeed3b27dec04521e4e42107012851 |
|
MD5 | 433e83f51550b3b7fcab9c6a25cc9467 |
|
BLAKE2b-256 | 65b86d186af348ee82a66485462b71be4f8cc50b756aa6653fb515756ab4959a |
File details
Details for the file dbt_tests_adapter-1.10.3-py3-none-any.whl
.
File metadata
- Download URL: dbt_tests_adapter-1.10.3-py3-none-any.whl
- Upload date:
- Size: 220.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f6f47f96f714200ba6c94aec6f0e116e216cb8fcc4752aa853c731b4453f3b2 |
|
MD5 | a052dc5ec243703977037ea3b94e3243 |
|
BLAKE2b-256 | 96d7d13797e6c9562a47efe0904da0c1fd625073f219bd7913db476301daa1a3 |