Skip to content
Prev Previous commit
Next Next commit
Verbose CLI argument for skipping profile setup
  • Loading branch information
dbeatty10 committed May 23, 2023
commit d8b02365f05c679d8347f8ddae8f2ef01b046e40
8 changes: 4 additions & 4 deletions tests/functional/init/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def test_init_invalid_project_name_cli(
manager.prompt.side_effect = [valid_name]
mock_get_adapter.return_value = [project.adapter.type()]

run_dbt(["init", invalid_name, "-s"])
run_dbt(["init", invalid_name, "--skip-profile-setup"])
manager.assert_has_calls(
[
call.prompt("Enter a name for your project (letters, digits, underscore)"),
Expand All @@ -613,7 +613,7 @@ def test_init_invalid_project_name_prompt(
manager.prompt.side_effect = [invalid_name, valid_name]
mock_get_adapter.return_value = [project.adapter.type()]

run_dbt(["init", "-s"])
run_dbt(["init", "--skip-profile-setup"])
manager.assert_has_calls(
[
call.prompt("Enter a name for your project (letters, digits, underscore)"),
Expand Down Expand Up @@ -645,7 +645,7 @@ def test_init_provided_project_name_and_skip_profile_setup(
mock_get.return_value = [project.adapter.type()]

# provide project name through the init command
run_dbt(["init", project_name, "-s"])
run_dbt(["init", project_name, "--skip-profile-setup"])
assert len(manager.mock_calls) == 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from assert_not_called() to asserting that manager.mock_calls is empty because the former didn't appear to ever fail when I tested it by hand, even when there were calls to the mocks.


with open(os.path.join(project.project_root, project_name, "dbt_project.yml"), "r") as f:
Expand Down Expand Up @@ -706,5 +706,5 @@ def test_init_inside_project_and_skip_profile_setup(
assert Path("dbt_project.yml").exists()

# skip interactive profile setup
run_dbt(["init", "-s"])
run_dbt(["init", "--skip-profile-setup"])
assert len(manager.mock_calls) == 0