diff --git a/tests/dbt/test_graph.py b/tests/dbt/test_graph.py index 530d8b469..2547a4885 100644 --- a/tests/dbt/test_graph.py +++ b/tests/dbt/test_graph.py @@ -6,8 +6,8 @@ import pytest from cosmos.config import ProfileConfig -from cosmos.constants import ExecutionMode, DbtResourceType -from cosmos.dbt.graph import DbtGraph, LoadMode, CosmosLoadDbtException +from cosmos.constants import DbtResourceType, ExecutionMode +from cosmos.dbt.graph import CosmosLoadDbtException, DbtGraph, LoadMode from cosmos.dbt.project import DbtProject from cosmos.profiles import PostgresUserPasswordProfileMapping @@ -319,9 +319,9 @@ def test_load_via_dbt_ls_with_non_zero_returncode(mock_popen): ) with pytest.raises(CosmosLoadDbtException) as err_info: dbt_graph.load_via_dbt_ls() + expected = "Unable to run dbt deps command due to the error:\nSome stderr message" assert err_info.value.args[0] == expected - mock_popen.communicate.assert_called_once() @pytest.mark.integration @@ -342,6 +342,7 @@ def test_load_via_dbt_ls_with_runtime_error_in_stdout(mock_popen_communicate): ) with pytest.raises(CosmosLoadDbtException) as err_info: dbt_graph.load_via_dbt_ls() + expected = "Unable to run dbt deps command due to the error:\nSome Runtime Error" assert err_info.value.args[0] == expected mock_popen_communicate.assert_called_once()