@@ -68,7 +68,9 @@ def test_run_all_success_with_approvers_approved(
6868 github_client ,
6969 bot_config = GithubCICDBotConfig (invalidate_environment_after_deploy = False ),
7070 )
71- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
71+ controller ._context ._run_tests = mocker .MagicMock (
72+ side_effect = lambda ** kwargs : (TestResult (), "" )
73+ )
7274 controller ._context .users = [
7375 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
7476 ]
@@ -193,7 +195,9 @@ def test_run_all_success_with_approvers_approved_merge_delete(
193195 github_client ,
194196 bot_config = GithubCICDBotConfig (merge_method = MergeMethod .REBASE ),
195197 )
196- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
198+ controller ._context ._run_tests = mocker .MagicMock (
199+ side_effect = lambda ** kwargs : (TestResult (), "" )
200+ )
197201 controller ._context .users = [
198202 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
199203 ]
@@ -320,7 +324,9 @@ def test_run_all_missing_approval(
320324 github_client ,
321325 bot_config = GithubCICDBotConfig (invalidate_environment_after_deploy = False ),
322326 )
323- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
327+ controller ._context ._run_tests = mocker .MagicMock (
328+ side_effect = lambda ** kwargs : (TestResult (), "" )
329+ )
324330 controller ._context .users = [
325331 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
326332 ]
@@ -440,7 +446,7 @@ def test_run_all_test_failed(
440446 test_result = TestResult ()
441447 test_result .addFailure (TestCase (), (None , None , None ))
442448 controller ._context ._run_tests = mocker .MagicMock (
443- side_effect = lambda : (test_result , "some error" )
449+ side_effect = lambda ** kwargs : (test_result , "some error" )
444450 )
445451 controller ._context .users = [
446452 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
@@ -561,7 +567,9 @@ def test_pr_update_failure(
561567 github_client ,
562568 bot_config = GithubCICDBotConfig (merge_method = MergeMethod .REBASE ),
563569 )
564- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
570+ controller ._context ._run_tests = mocker .MagicMock (
571+ side_effect = lambda ** kwargs : (TestResult (), "" )
572+ )
565573 controller ._context .users = [
566574 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
567575 ]
@@ -681,7 +689,9 @@ def test_prod_update_failure(
681689 github_client ,
682690 bot_config = GithubCICDBotConfig (merge_method = MergeMethod .REBASE ),
683691 )
684- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
692+ controller ._context ._run_tests = mocker .MagicMock (
693+ side_effect = lambda ** kwargs : (TestResult (), "" )
694+ )
685695 controller ._context .users = [
686696 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
687697 ]
@@ -815,7 +825,9 @@ def test_comment_command_invalid(
815825 github_client ,
816826 bot_config = GithubCICDBotConfig (merge_method = MergeMethod .REBASE ),
817827 )
818- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
828+ controller ._context ._run_tests = mocker .MagicMock (
829+ side_effect = lambda ** kwargs : (TestResult (), "" )
830+ )
819831 controller ._context .users = [
820832 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
821833 ]
@@ -882,7 +894,9 @@ def test_comment_command_deploy_prod(
882894 github_client ,
883895 bot_config = GithubCICDBotConfig (merge_method = MergeMethod .REBASE , enable_deploy_command = True ),
884896 )
885- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
897+ controller ._context ._run_tests = mocker .MagicMock (
898+ side_effect = lambda ** kwargs : (TestResult (), "" )
899+ )
886900 controller ._context .users = [
887901 User (username = "test" , github_username = "test_github" , roles = [UserRole .REQUIRED_APPROVER ])
888902 ]
@@ -1002,7 +1016,9 @@ def test_comment_command_deploy_prod_not_enabled(
10021016 github_client ,
10031017 bot_config = GithubCICDBotConfig (merge_method = MergeMethod .REBASE ),
10041018 )
1005- controller ._context ._run_tests = mocker .MagicMock (side_effect = lambda : (TestResult (), "" ))
1019+ controller ._context ._run_tests = mocker .MagicMock (
1020+ side_effect = lambda ** kwargs : (TestResult (), "" )
1021+ )
10061022 controller ._context .users = []
10071023 controller ._context .invalidate_environment = mocker .MagicMock ()
10081024
0 commit comments