@@ -85,7 +85,7 @@ def test_cli_run_with_args_fd(capfd):
85
85
def test_cli_run_subprocess_exception (runner , mocker ):
86
86
result = runner .invoke (cli .run , [os .devnull ])
87
87
out = result .output .splitlines ()
88
- assert out [- 1 ].startswith ("Error: Failed to run ['/dev/null ', '--cmd'," )
88
+ assert out [- 1 ].startswith ("Error: Failed to run ['%s ', '--cmd'," % os . devnull )
89
89
assert '[Errno 13] Permission denied' in out [- 1 ]
90
90
assert result .exit_code == 1
91
91
@@ -136,7 +136,7 @@ def test_cli_run_args(runner, mocker, devnull, tmpdir):
136
136
assert m .call_args [0 ] == (['printf' , '--' , '--headless' ],)
137
137
assert result .output .splitlines () == [
138
138
'Running cmd: printf -- --headless (in %s)' % os .getcwd (),
139
- 'Parsing profile file /dev/null.' ,
139
+ 'Parsing profile file %s.' % os . devnull ,
140
140
'Not writing coverage file: no data to report!' ,
141
141
'Error: Command exited non-zero: 3.' ]
142
142
@@ -329,7 +329,7 @@ def test_cli_call_verbosity_fd(capfd):
329
329
out , err = capfd .readouterr ()
330
330
assert out == ''
331
331
assert err .splitlines () == [
332
- 'Parsing file: /dev/null' ,
332
+ 'Parsing file: %s' % os . devnull ,
333
333
'source_files: []' ,
334
334
'Not writing coverage file: no data to report!' ,
335
335
'Error: No data to report.' ]
@@ -338,7 +338,7 @@ def test_cli_call_verbosity_fd(capfd):
338
338
out , err = capfd .readouterr ()
339
339
assert out == ''
340
340
assert err .splitlines () == [
341
- 'Parsing file: /dev/null' ,
341
+ 'Parsing file: %s' % os . devnull ,
342
342
'source_files: []' ,
343
343
'Not writing coverage file: no data to report!' ,
344
344
'Error: No data to report.' ]
@@ -490,7 +490,7 @@ def test_report_profile_or_data_file(runner, tmpdir):
490
490
'report' , '--data-file' , os .devnull ])
491
491
cov_exc = 'CoverageException: Doesn\' t seem to be a coverage.py data file'
492
492
assert result .output .splitlines ()[- 1 ] == \
493
- 'Error: Coverage could not read data_file: /dev/null (%s)' % cov_exc
493
+ 'Error: Coverage could not read data_file: %s (%s)' % ( os . devnull , cov_exc )
494
494
assert result .exit_code == 1
495
495
496
496
with tmpdir .as_cwd ():
0 commit comments