Skip to content

Commit 7b3dbd9

Browse files
Chore: Fix flaky test when profiles yaml might exist (#5536)
1 parent 15dac12 commit 7b3dbd9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/dbt/cli/test_global_flags.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def test_profiles_dir(
127127
# should fail if we don't specify --profiles-dir
128128
result = invoke_cli(["list"])
129129
assert result.exit_code > 0, result.output
130-
assert "profiles.yml not found" in result.output
130+
131+
# alternative ~/.dbt/profiles.yml might exist but doesn't contain the profile
132+
assert "profiles.yml not found" in result.output or "not found in profiles" in result.output
131133

132134
# should pass if we specify --profiles-dir
133135
result = invoke_cli(["--profiles-dir", str(new_profiles_yml.parent), "list"])
@@ -158,7 +160,9 @@ def test_project_dir(
158160
# should fail if the profiles.yml also doesnt exist at that --project-dir
159161
result = invoke_cli(["--project-dir", str(new_project_yml.parent), "list"])
160162
assert result.exit_code != 0, result.output
161-
assert "profiles.yml not found" in result.output
163+
164+
# profiles.yml might exist but doesn't contain the profile
165+
assert "profiles.yml not found" in result.output or "not found in profiles" in result.output
162166

163167
# should pass if it can find both files, either because we specified --profiles-dir explicitly or the profiles.yml was found in --project-dir
164168
result = invoke_cli(

0 commit comments

Comments
 (0)