dbt-tests-adapter


Namedbt-tests-adapter JSON
Version 1.10.4 PyPI version JSON
download
home_pageNone
SummaryThe set of reusable tests and test fixtures used to test common functionality
upload_time2024-11-12 00:02:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9.0
licenseNone
keywords adapter adapters database dbt dbt cloud dbt core dbt labs dbt-core elt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg" alt="dbt logo" width="500"/>
</p>

# dbt-tests-adapter

For context and guidance on using this package, please read: ["Testing a new adapter"](https://docs.getdbt.com/docs/contributing/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:

1. **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 with `skip` or `xfail`](https://docs.pytest.org/en/latest/how-to/skipping.html), as well as noting that limitation in any documentation, READMEs, and usage guides that accompany your adapter.

2. **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.

```python
class TestSimpleMaterializations(BaseSimpleMaterializations):
    pass
```

## Distribution

To install:

```sh
pip install dbt-tests-adapter
```

This package is versioned in lockstep with `dbt-core`, and [the same versioning guidelines](https://docs.getdbt.com/docs/core-versions) 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dbt-tests-adapter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": "dbt Labs <info@dbtlabs.com>",
    "keywords": "adapter, adapters, database, dbt, dbt Cloud, dbt Core, dbt Labs, dbt-core, elt",
    "author": null,
    "author_email": "dbt Labs <info@dbtlabs.com>",
    "download_url": "https://files.pythonhosted.org/packages/58/27/e24e9239e33c091c321213385eca3f61821c0750ef72872f29298b5c1f57/dbt_tests_adapter-1.10.4.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg\" alt=\"dbt logo\" width=\"500\"/>\n</p>\n\n# dbt-tests-adapter\n\nFor context and guidance on using this package, please read: [\"Testing a new adapter\"](https://docs.getdbt.com/docs/contributing/testing-a-new-adapter)\n\n## What is it?\n\nThis package includes reusable test cases that reinforce behaviors common to all or many adapter plugins. There are two categories of tests:\n\n1. **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 with `skip` or `xfail`](https://docs.pytest.org/en/latest/how-to/skipping.html), as well as noting that limitation in any documentation, READMEs, and usage guides that accompany your adapter.\n\n2. **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.\n\n## How to use it?\n\nEach 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.\n\n```python\nclass TestSimpleMaterializations(BaseSimpleMaterializations):\n    pass\n```\n\n## Distribution\n\nTo install:\n\n```sh\npip install dbt-tests-adapter\n```\n\nThis package is versioned in lockstep with `dbt-core`, and [the same versioning guidelines](https://docs.getdbt.com/docs/core-versions) apply:\n- New \"basic\" test cases MAY be added in minor versions ONLY. They may not be included in patch releases.\n- 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.\n- New \"optional\" test cases, and non-breaking fixes to existing test cases, MAY be added in minor or patch versions.\n\nAssuming 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`.\n\n**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.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The set of reusable tests and test fixtures used to test common functionality",
    "version": "1.10.4",
    "project_urls": {
        "Changelog": "https://github.com/dbt-labs/dbt-adapters/blob/main/CHANGELOG.md",
        "Documentation": "https://docs.getdbt.com",
        "Homepage": "https://github.com/dbt-labs/dbt-adapters",
        "Issues": "https://github.com/dbt-labs/dbt-adapters/issues",
        "Repository": "https://github.com/dbt-labs/dbt-adapters.git"
    },
    "split_keywords": [
        "adapter",
        " adapters",
        " database",
        " dbt",
        " dbt cloud",
        " dbt core",
        " dbt labs",
        " dbt-core",
        " elt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a10371af943d0cdfcc4384815c57012908c8e271ec8aef900a1c98fea2dff522",
                "md5": "b3ec989ad9f014afca7d867b506340eb",
                "sha256": "b12a0637662b4ea7cf5c012c4b9627ce9d3bbe7657239ce49b6f9b9de776b789"
            },
            "downloads": -1,
            "filename": "dbt_tests_adapter-1.10.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b3ec989ad9f014afca7d867b506340eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 220180,
            "upload_time": "2024-11-12T00:02:17",
            "upload_time_iso_8601": "2024-11-12T00:02:17.869620Z",
            "url": "https://files.pythonhosted.org/packages/a1/03/71af943d0cdfcc4384815c57012908c8e271ec8aef900a1c98fea2dff522/dbt_tests_adapter-1.10.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5827e24e9239e33c091c321213385eca3f61821c0750ef72872f29298b5c1f57",
                "md5": "5667195ddd7d715807792c4a41143302",
                "sha256": "e15eece8390252b611fda2ff60e4ba1a1d36fc86b7550b7bfe215e9e7ec5888f"
            },
            "downloads": -1,
            "filename": "dbt_tests_adapter-1.10.4.tar.gz",
            "has_sig": false,
            "md5_digest": "5667195ddd7d715807792c4a41143302",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 152221,
            "upload_time": "2024-11-12T00:02:20",
            "upload_time_iso_8601": "2024-11-12T00:02:20.093241Z",
            "url": "https://files.pythonhosted.org/packages/58/27/e24e9239e33c091c321213385eca3f61821c0750ef72872f29298b5c1f57/dbt_tests_adapter-1.10.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-12 00:02:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dbt-labs",
    "github_project": "dbt-adapters",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dbt-tests-adapter"
}
        
Elapsed time: 0.37715s