@@ -73,9 +73,12 @@ def test_find_executable(self, tmp_path):
73
73
# PATH='': no match, except in the current directory
74
74
with os_helper .EnvironmentVarGuard () as env :
75
75
env ['PATH' ] = ''
76
- with mock .patch (
77
- 'distutils.spawn.os.confstr' , return_value = tmp_dir , create = True
78
- ), mock .patch ('distutils.spawn.os.defpath' , tmp_dir ):
76
+ with (
77
+ mock .patch (
78
+ 'distutils.spawn.os.confstr' , return_value = tmp_dir , create = True
79
+ ),
80
+ mock .patch ('distutils.spawn.os.defpath' , tmp_dir ),
81
+ ):
79
82
rv = find_executable (program )
80
83
assert rv is None
81
84
@@ -87,9 +90,10 @@ def test_find_executable(self, tmp_path):
87
90
# PATH=':': explicitly looks in the current directory
88
91
with os_helper .EnvironmentVarGuard () as env :
89
92
env ['PATH' ] = os .pathsep
90
- with mock .patch (
91
- 'distutils.spawn.os.confstr' , return_value = '' , create = True
92
- ), mock .patch ('distutils.spawn.os.defpath' , '' ):
93
+ with (
94
+ mock .patch ('distutils.spawn.os.confstr' , return_value = '' , create = True ),
95
+ mock .patch ('distutils.spawn.os.defpath' , '' ),
96
+ ):
93
97
rv = find_executable (program )
94
98
assert rv is None
95
99
@@ -103,16 +107,22 @@ def test_find_executable(self, tmp_path):
103
107
env .pop ('PATH' , None )
104
108
105
109
# without confstr
106
- with mock .patch (
107
- 'distutils.spawn.os.confstr' , side_effect = ValueError , create = True
108
- ), mock .patch ('distutils.spawn.os.defpath' , tmp_dir ):
110
+ with (
111
+ mock .patch (
112
+ 'distutils.spawn.os.confstr' , side_effect = ValueError , create = True
113
+ ),
114
+ mock .patch ('distutils.spawn.os.defpath' , tmp_dir ),
115
+ ):
109
116
rv = find_executable (program )
110
117
assert rv == filename
111
118
112
119
# with confstr
113
- with mock .patch (
114
- 'distutils.spawn.os.confstr' , return_value = tmp_dir , create = True
115
- ), mock .patch ('distutils.spawn.os.defpath' , '' ):
120
+ with (
121
+ mock .patch (
122
+ 'distutils.spawn.os.confstr' , return_value = tmp_dir , create = True
123
+ ),
124
+ mock .patch ('distutils.spawn.os.defpath' , '' ),
125
+ ):
116
126
rv = find_executable (program )
117
127
assert rv == filename
118
128
0 commit comments