@@ -73,9 +73,12 @@ def test_find_executable(self, tmp_path):
7373 # PATH='': no match, except in the current directory
7474 with os_helper .EnvironmentVarGuard () as env :
7575 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+ ):
7982 rv = find_executable (program )
8083 assert rv is None
8184
@@ -87,9 +90,10 @@ def test_find_executable(self, tmp_path):
8790 # PATH=':': explicitly looks in the current directory
8891 with os_helper .EnvironmentVarGuard () as env :
8992 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+ ):
9397 rv = find_executable (program )
9498 assert rv is None
9599
@@ -103,16 +107,22 @@ def test_find_executable(self, tmp_path):
103107 env .pop ('PATH' , None )
104108
105109 # 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+ ):
109116 rv = find_executable (program )
110117 assert rv == filename
111118
112119 # 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+ ):
116126 rv = find_executable (program )
117127 assert rv == filename
118128
0 commit comments