16
16
17
17
18
18
def test_default (dda , helpers , temp_dir , uv_on_path , mocker ):
19
- replace_current_process = mocker .patch ("dda.utils.process.SubprocessRunner.replace_current_process" )
19
+ replace_current_process = mocker .patch (
20
+ "dda.utils.process.SubprocessRunner.replace_current_process" ,
21
+ side_effect = lambda * args , ** kwargs : sys .exit (0 ), # noqa: ARG005
22
+ )
20
23
subprocess_run = mocker .patch ("subprocess.run" , return_value = subprocess .CompletedProcess ([], returncode = 0 ))
21
24
22
25
result = dda ("inv" , "foo" )
@@ -73,7 +76,10 @@ def test_default(dda, helpers, temp_dir, uv_on_path, mocker):
73
76
74
77
75
78
def test_no_dynamic_deps_flag (dda , mocker ):
76
- replace_current_process = mocker .patch ("dda.utils.process.SubprocessRunner.replace_current_process" )
79
+ replace_current_process = mocker .patch (
80
+ "dda.utils.process.SubprocessRunner.replace_current_process" ,
81
+ side_effect = lambda * args , ** kwargs : sys .exit (0 ), # noqa: ARG005
82
+ )
77
83
78
84
result = dda ("inv" , "--no-dynamic-deps" , "foo" )
79
85
@@ -93,7 +99,10 @@ def test_no_dynamic_deps_flag(dda, mocker):
93
99
94
100
95
101
def test_no_dynamic_deps_env_var (dda , mocker ):
96
- replace_current_process = mocker .patch ("dda.utils.process.SubprocessRunner.replace_current_process" )
102
+ replace_current_process = mocker .patch (
103
+ "dda.utils.process.SubprocessRunner.replace_current_process" ,
104
+ side_effect = lambda * args , ** kwargs : sys .exit (0 ), # noqa: ARG005
105
+ )
97
106
98
107
with EnvVars ({AppEnvVars .NO_DYNAMIC_DEPS : "1" }):
99
108
result = dda ("inv" , "foo" )
0 commit comments