Skip to content

Commit 270aed3

Browse files
authored
Fix: Skip unit tests when explaining the plan (#4669)
1 parent ff87b03 commit 270aed3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

sqlmesh/core/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ def plan_builder(
14031403
k: v for k, v in kwargs.items() if v is not None
14041404
}
14051405

1406-
skip_tests = skip_tests or False
1406+
skip_tests = explain or skip_tests or False
14071407
no_gaps = no_gaps or False
14081408
skip_backfill = skip_backfill or False
14091409
empty_backfill = empty_backfill or False

tests/core/test_context.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import sqlmesh.core.constants
1818
from sqlmesh.cli.example_project import init_example_project
19+
from sqlmesh.core.console import get_console, TerminalConsole
1920
from sqlmesh.core import dialect as d, constants as c
2021
from sqlmesh.core.config import (
2122
load_configs,
@@ -2125,3 +2126,10 @@ def test_prompt_if_uncategorized_snapshot(mocker: MockerFixture, tmp_path: Path)
21252126
# False instead of respecting the default plan config value, which is True
21262127
assert calls[0].kwargs["no_prompts"] == False
21272128
assert context.config.plan.no_prompts == True
2129+
2130+
2131+
def test_plan_explain_skips_tests(sushi_context: Context, mocker: MockerFixture) -> None:
2132+
sushi_context.console = TerminalConsole()
2133+
spy = mocker.spy(sushi_context, "_run_plan_tests")
2134+
sushi_context.plan(environment="dev", explain=True, no_prompts=True, include_unmodified=True)
2135+
spy.assert_called_once_with(skip_tests=True)

0 commit comments

Comments
 (0)