Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran Lozano committed Dec 8, 2019
1 parent 564cc22 commit 58a371f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/dbt/task/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, args, config):
self.profiles_dir = getattr(self.args, 'profiles_dir',
dbt.config.PROFILES_DIR)
self.profile_path = os.path.join(self.profiles_dir, 'profiles.yml')
self.project_path = os.path.join(os.getcwd(), 'dbt_project.yml')
self.project_path = os.path.join(args.project_dir or os.getcwd(), 'dbt_project.yml')
self.cli_vars = dbt.utils.parse_cli_vars(
getattr(self.args, 'vars', '{}')
)
Expand Down
9 changes: 9 additions & 0 deletions test/integration/049_dbt_debug_test/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,12 @@ def test_postgres_badproject(self):
self.assertIn('ERROR invalid', line)
elif line.strip().startswith('profiles.yml file'):
self.assertNotIn('ERROR invalid', line)

@use_profile('postgres')
def test_postgres_invalid_project_dir(self):
self.use_default_project()
self.run_dbt(['debug', '--project-dir', 'nopass'])
splitout = self.capsys.readouterr().out.split('\n')
for line in splitout:
if line.strip().startswith('dbt_project.yml file'):
self.assertIn('ERROR not found', line)

0 comments on commit 58a371f

Please sign in to comment.