Skip to content

Commit

Permalink
Reduce the virtualenv unit test run time (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana authored Jun 6, 2023
1 parent c107430 commit 1f118ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cosmos/providers/dbt/core/operators/tests/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from cosmos.providers.dbt.core.operators.virtualenv import DbtVirtualenvBaseOperator


@patch("airflow.utils.python_virtualenv.execute_in_subprocess")
@patch("cosmos.providers.dbt.core.operators.virtualenv.DbtLocalBaseOperator.store_compiled_sql")
@patch("cosmos.providers.dbt.core.operators.virtualenv.DbtLocalBaseOperator.exception_handling")
@patch("cosmos.providers.dbt.core.operators.virtualenv.DbtLocalBaseOperator.subprocess_hook")
def test_run_command(mock_subprocess_hook, mock_exception_handling, mock_store_compiled_sql):
def test_run_command(mock_subprocess_hook, mock_exception_handling, mock_store_compiled_sql, mock_execute):
venv_operator = DbtVirtualenvBaseOperator(
conn_id="fake_conn",
task_id="fake_task",
Expand All @@ -27,3 +28,4 @@ def test_run_command(mock_subprocess_hook, mock_exception_handling, mock_store_c
assert dbt_deps[0][0][0].endswith("/bin/dbt")
assert dbt_deps[0][0][0] == dbt_cmd[0][0][0]
assert dbt_cmd[0][0][1] == "do-something"
assert mock_execute.call_count == 2

0 comments on commit 1f118ec

Please sign in to comment.