Skip to content

Commit e1f589d

Browse files
committed
fix: adjusting tests to new run tests args
Signed-off-by: Cortland Goffena <30168413+cmgoffena13@users.noreply.github.com>
1 parent f848cb6 commit e1f589d

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

tests/core/test_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import re
55
from datetime import date, timedelta, datetime
66
from tempfile import TemporaryDirectory
7-
from unittest.mock import PropertyMock, call, patch
7+
from unittest.mock import ANY, PropertyMock, call, patch
88

99
import time_machine
1010
import pytest
@@ -3607,7 +3607,7 @@ def test_plan_explain_skips_tests(sushi_context: Context, mocker: MockerFixture)
36073607
sushi_context.console = TerminalConsole()
36083608
spy = mocker.spy(sushi_context, "_run_plan_tests")
36093609
sushi_context.plan(environment="dev", explain=True, no_prompts=True, include_unmodified=True)
3610-
spy.assert_called_once_with(skip_tests=True)
3610+
spy.assert_called_once_with(skip_tests=True, all_tests=False, model_names=ANY)
36113611

36123612

36133613
def test_dev_environment_virtual_update_with_environment_statements(tmp_path: Path) -> None:

tests/integrations/github/cicd/test_github_controller.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import pathlib
55
from unittest import mock
6-
from unittest.mock import PropertyMock, call
6+
from unittest.mock import ANY, PropertyMock, call
77

88
import pytest
99
import time_machine
@@ -256,7 +256,9 @@ def test_pr_plan(github_client, make_controller):
256256
assert controller.pr_plan.skip_backfill
257257
assert not controller.pr_plan.no_gaps
258258
assert not controller._context.apply.called
259-
assert controller._context._run_plan_tests.call_args == call(skip_tests=True)
259+
assert controller._context._run_plan_tests.call_args == call(
260+
skip_tests=True, all_tests=False, model_names=ANY
261+
)
260262
assert (
261263
controller._pr_plan_builder._categorizer_config
262264
== controller._context.auto_categorize_changes
@@ -278,7 +280,9 @@ def test_pr_plan_auto_categorization(github_client, make_controller):
278280
assert controller.pr_plan.skip_backfill
279281
assert not controller.pr_plan.no_gaps
280282
assert not controller._context.apply.called
281-
assert controller._context._run_plan_tests.call_args == call(skip_tests=True)
283+
assert controller._context._run_plan_tests.call_args == call(
284+
skip_tests=True, all_tests=False, model_names=ANY
285+
)
282286
assert controller._pr_plan_builder._categorizer_config == custom_categorizer_config
283287
assert controller.pr_plan.start == default_start_absolute
284288
assert not controller.pr_plan.start_override_per_model
@@ -365,7 +369,9 @@ def test_prod_plan(github_client, make_controller):
365369
assert not controller.prod_plan.skip_backfill
366370
assert controller.prod_plan.no_gaps
367371
assert not controller._context.apply.called
368-
assert controller._context._run_plan_tests.call_args == call(skip_tests=True)
372+
assert controller._context._run_plan_tests.call_args == call(
373+
skip_tests=True, all_tests=False, model_names=ANY
374+
)
369375
assert (
370376
controller._prod_plan_builder._categorizer_config
371377
== controller._context.auto_categorize_changes
@@ -387,7 +393,9 @@ def test_prod_plan_auto_categorization(github_client, make_controller):
387393
assert not controller.prod_plan.skip_backfill
388394
assert controller.prod_plan.no_gaps
389395
assert not controller._context.apply.called
390-
assert controller._context._run_plan_tests.call_args == call(skip_tests=True)
396+
assert controller._context._run_plan_tests.call_args == call(
397+
skip_tests=True, all_tests=False, model_names=ANY
398+
)
391399
assert controller._prod_plan_builder._categorizer_config == custom_categorizer_config
392400
# default PR start should be ignored for prod plans
393401
assert controller.prod_plan.start != default_pr_start
@@ -404,7 +412,9 @@ def test_prod_plan_with_gaps(github_client, make_controller):
404412
assert controller._prod_plan_with_gaps_builder._auto_categorization_enabled
405413
assert not controller.prod_plan_with_gaps.no_gaps
406414
assert not controller._context.apply.called
407-
assert controller._context._run_plan_tests.call_args == call(skip_tests=True)
415+
assert controller._context._run_plan_tests.call_args == call(
416+
skip_tests=True, all_tests=False, model_names=ANY
417+
)
408418

409419

410420
def test_run_tests(github_client, make_controller):

0 commit comments

Comments
 (0)