diff --git a/tests/functional/data_test_patch/fixtures.py b/tests/functional/data_test_patch/fixtures.py index be056f32680..1e4815be6c5 100644 --- a/tests/functional/data_test_patch/fixtures.py +++ b/tests/functional/data_test_patch/fixtures.py @@ -17,6 +17,16 @@ some_key: some_val """ +tests__schema_2_yml = """ +data_tests: + - name: my_singular_test + description: "My singular test description" + config: + error_if: ">10" + meta: + some_key: some_val +""" + tests__doc_block_md = """ {% docs my_singular_test_documentation %} diff --git a/tests/functional/data_test_patch/test_singular_test_patch.py b/tests/functional/data_test_patch/test_singular_test_patch.py index df359c5e645..23de71590fb 100644 --- a/tests/functional/data_test_patch/test_singular_test_patch.py +++ b/tests/functional/data_test_patch/test_singular_test_patch.py @@ -2,12 +2,13 @@ import pytest -from dbt.tests.util import get_artifact, run_dbt, run_dbt_and_capture +from dbt.tests.util import get_artifact, run_dbt, run_dbt_and_capture, write_file from tests.functional.data_test_patch.fixtures import ( tests__doc_block_md, tests__invalid_name_schema_yml, tests__malformed_schema_yml, tests__my_singular_test_sql, + tests__schema_2_yml, tests__schema_yml, ) @@ -31,6 +32,12 @@ def test_compile(self, project): assert my_singular_test_node["config"]["error_if"] == ">10" assert my_singular_test_node["config"]["meta"] == {"some_key": "some_val"} + # partial parsing test + write_file(tests__schema_2_yml, project.project_root, "tests", "schema.yml") + manifest = run_dbt(["parse"]) + test_node = manifest.nodes["test.test.my_singular_test"] + assert test_node.description == "My singular test description" + class TestPatchSingularTestInvalidName: @pytest.fixture(scope="class")