-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve error message when entry does not have name
- Loading branch information
1 parent
d8b1bf5
commit 36148c4
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
|
||
from dbt.exceptions import ParsingError | ||
from dbt.tests.util import run_dbt | ||
|
||
schema_yml_model_no_name = """ | ||
data_tests: | ||
- description: "{{ doc('my_singular_test_documentation') }}" | ||
config: | ||
error_if: ">10" | ||
meta: | ||
some_key: some_val | ||
""" | ||
|
||
|
||
class TestParsingErrors: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"schema.yml": schema_yml_model_no_name, | ||
} | ||
|
||
def test_parsing_error_no_entry_name(self, project): | ||
with pytest.raises( | ||
ParsingError, match="Entry in 'models/schema.yml' did not contain a name" | ||
): | ||
run_dbt(["parse"]) |