Skip to content

Commit

Permalink
Tests: use temp dir for `test_load_via_dbt_ls_without_dbt_deps_and_pr…
Browse files Browse the repository at this point in the history
…einstalled_dbt_packages` (#748)

This is a follow up to #730 so that the fixture `tmp_dbt_project_dir` is
used for the test instead of the actual project directory since it
installs dbt packages that need to be cleaned up.
  • Loading branch information
jbandoro authored Dec 6, 2023
1 parent 2988649 commit 3bc60a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/dbt/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,12 @@ def test_load_via_dbt_ls_without_dbt_deps():


@pytest.mark.integration
def test_load_via_dbt_ls_without_dbt_deps_and_preinstalled_dbt_packages():
def test_load_via_dbt_ls_without_dbt_deps_and_preinstalled_dbt_packages(tmp_dbt_project_dir):
local_flags = [
"--project-dir",
DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME,
tmp_dbt_project_dir / DBT_PROJECT_NAME,
"--profiles-dir",
DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME,
tmp_dbt_project_dir / DBT_PROJECT_NAME,
"--profile",
"default",
"--target",
Expand All @@ -456,14 +456,14 @@ def test_load_via_dbt_ls_without_dbt_deps_and_preinstalled_dbt_packages():
deps_command,
stdout=PIPE,
stderr=PIPE,
cwd=DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME,
cwd=tmp_dbt_project_dir / DBT_PROJECT_NAME,
universal_newlines=True,
)
stdout, stderr = process.communicate()

project_config = ProjectConfig(dbt_project_path=DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME)
render_config = RenderConfig(dbt_project_path=DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME, dbt_deps=False)
execution_config = ExecutionConfig(dbt_project_path=DBT_PROJECTS_ROOT_DIR / DBT_PROJECT_NAME)
project_config = ProjectConfig(dbt_project_path=tmp_dbt_project_dir / DBT_PROJECT_NAME)
render_config = RenderConfig(dbt_project_path=tmp_dbt_project_dir / DBT_PROJECT_NAME, dbt_deps=False)
execution_config = ExecutionConfig(dbt_project_path=tmp_dbt_project_dir / DBT_PROJECT_NAME)
dbt_graph = DbtGraph(
project=project_config,
render_config=render_config,
Expand Down

0 comments on commit 3bc60a9

Please sign in to comment.