@@ -146,7 +146,7 @@ def test_nonexistent_visual(self, capsys):
146146
147147 def test_failed_editor (self , capsys ):
148148 with (
149- os_environ ("VISUAL" , EDITOR = "sed -i 's///'" ),
149+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' s///'" ),
150150 patch ("sys.argv" , self .args + ["cat/pkg" ]),
151151 pytest .raises (SystemExit ),
152152 chdir (pjoin (self .repo .path )),
@@ -157,7 +157,7 @@ def test_failed_editor(self, capsys):
157157
158158 def test_empty_mask_comment (self , capsys ):
159159 with (
160- os_environ ("VISUAL" , EDITOR = "sed -i 's/#/#/'" ),
160+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' s/#/#/'" ),
161161 patch ("sys.argv" , self .args + ["cat/pkg" ]),
162162 pytest .raises (SystemExit ),
163163 chdir (pjoin (self .repo .path )),
@@ -168,7 +168,7 @@ def test_empty_mask_comment(self, capsys):
168168
169169 def test_mask_cwd (self ):
170170 with (
171- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
171+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
172172 patch ("sys.argv" , self .args ),
173173 pytest .raises (SystemExit ),
174174 chdir (pjoin (self .repo .path , "cat/pkg" )),
@@ -178,7 +178,7 @@ def test_mask_cwd(self):
178178
179179 def test_mask_target (self ):
180180 with (
181- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
181+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
182182 patch ("sys.argv" , self .args + ["cat/pkg" ]),
183183 pytest .raises (SystemExit ),
184184 chdir (pjoin (self .repo .path )),
@@ -188,7 +188,7 @@ def test_mask_target(self):
188188
189189 def test_mask_ebuild_path (self ):
190190 with (
191- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
191+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
192192 patch ("sys.argv" , self .args + ["cat/pkg/pkg-0.ebuild" ]),
193193 pytest .raises (SystemExit ),
194194 chdir (pjoin (self .repo .path )),
@@ -208,7 +208,7 @@ def test_existing_masks(self):
208208 )
209209
210210 with (
211- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
211+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
212212 patch ("sys.argv" , self .args + ["=cat/pkg-0" ]),
213213 pytest .raises (SystemExit ),
214214 chdir (pjoin (self .repo .path )),
@@ -236,7 +236,7 @@ def test_invalid_header(self, capsys):
236236 )
237237
238238 with (
239- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
239+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
240240 patch ("sys.argv" , self .args + ["=cat/pkg-0" ]),
241241 pytest .raises (SystemExit ),
242242 chdir (pjoin (self .repo .path )),
@@ -268,7 +268,7 @@ def test_invalid_author(self, capsys):
268268 )
269269
270270 with (
271- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
271+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
272272 patch ("sys.argv" , self .args + ["=cat/pkg-0" ]),
273273 pytest .raises (SystemExit ),
274274 chdir (pjoin (self .repo .path )),
@@ -281,7 +281,7 @@ def test_last_rites(self):
281281 for rflag in ("-r" , "--rites" ):
282282 for args in ([rflag ], [rflag , "14" ]):
283283 with (
284- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
284+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
285285 patch ("sys.argv" , self .args + ["cat/pkg" ] + args ),
286286 pytest .raises (SystemExit ),
287287 chdir (pjoin (self .repo .path )),
@@ -308,7 +308,7 @@ def test_last_rites_with_email(self, tmp_path):
308308 for rflag in ("-r" , "--rites" ):
309309 with (
310310 os_environ (
311- "VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" , MAILER = f"> { output_file } echo"
311+ "VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" , MAILER = f"> { output_file } echo"
312312 ),
313313 patch ("sys.argv" , self .args + ["cat/pkg" , rflag , "--email" ]),
314314 pytest .raises (SystemExit ),
@@ -324,7 +324,7 @@ def test_last_rites_with_email(self, tmp_path):
324324 def test_last_email_bad_mailer (self , capsys ):
325325 for rflag in ("-r" , "--rites" ):
326326 with (
327- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" , MAILER = "false" ),
327+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" , MAILER = "false" ),
328328 patch ("sys.argv" , self .args + ["cat/pkg" , rflag , "--email" ]),
329329 pytest .raises (SystemExit ),
330330 chdir (pjoin (self .repo .path )),
@@ -345,7 +345,7 @@ def test_mask_bugs(self):
345345 for bug_num in bug_nums :
346346 args += [bflag , bug_num ]
347347 with (
348- os_environ ("VISUAL" , EDITOR = "sed -i '1s/$/mask comment/'" ),
348+ os_environ ("VISUAL" , EDITOR = "sed -i '' ' 1s/$/mask comment/'" ),
349349 patch ("sys.argv" , self .args + ["cat/pkg" ] + args ),
350350 pytest .raises (SystemExit ),
351351 chdir (pjoin (self .repo .path )),
0 commit comments