-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create a happy path project fixture #10291
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import pytest | ||
|
||
from dbt.tests.fixtures.project import write_project_files | ||
|
||
tests__cf_a_b_sql = """ | ||
select * from {{ ref('model_a') }} | ||
cross join {{ ref('model_b') }} | ||
|
@@ -84,14 +82,3 @@ def models(): | |
"model_b.sql": models__model_b_sql, | ||
"model_a.sql": models__model_a_sql, | ||
} | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def project_files( | ||
project_root, | ||
tests, | ||
models, | ||
selectors_yml, | ||
): | ||
write_project_files(project_root, "tests", tests) | ||
write_project_files(project_root, "models", models) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Were we able to remove this because of the existing more widely available There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, they are covered by the project_files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not asking for a change here, but I would like to understand the context. Does the ordering of the fixture arguments here mean something? Is there a reason the
project_setup
fixture has to be come beforeproject_files
? This is the kind of thing I would love to see in a commit comment so that I can better understand why something is changing while reviewing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, adding a comment in the following commit.
The order of the argument determines the order of fixtures being executed(if they need to).
So we do all setups, then write the project files. Setup should be independent of project file write.
Another reason is for the happy path fixture, we do not use the
dbt_project.yml
fixture, instead, we want to use the files in the fixture folder, changing the order makes sure that the tests run with the intended files