1515def test_dunder_main_run (capfd ):
1616 assert call ([sys .executable , '-m' , 'covimerage' ]) == 0
1717 out , err = capfd .readouterr ()
18- assert out .startswith ('Usage: __main__ ' )
18+ assert out .startswith ('Usage: covimerage ' )
1919
2020
2121def test_dunder_main_run_help (capfd ):
@@ -67,8 +67,8 @@ def test_cli_run_with_args_fd(capfd):
6767 out , err = capfd .readouterr ()
6868 lines = err .splitlines ()
6969 assert lines == [
70- "Running cmd: echo -- --no-profile %sMARKER --cmd 'profile start /doesnotexist' --cmd 'profile! file ./*' (in {})" .format (os .getcwd ()),
71- 'Error: The profile file (/doesnotexist) has not been created.' ]
70+ "covimerage: Running cmd: echo -- --no-profile %sMARKER --cmd 'profile start /doesnotexist' --cmd 'profile! file ./*' (in {})" .format (os .getcwd ()),
71+ 'covimerage: Error: The profile file (/doesnotexist) has not been created.' ]
7272 assert ret == 1
7373
7474
@@ -259,9 +259,9 @@ def test_cli_run_report_fd(capfd, tmpdir, devnull):
259259 '----------------------------------------------------------------' ,
260260 'tests/test_plugin/conditional_function.vim 13 5 62%' ]
261261 assert err .splitlines () == [
262- 'Running cmd: true (in %s)' % str (os .getcwd ()),
263- 'Parsing profile file %s.' % tmp_profile_fname ,
264- 'Writing coverage file %s.' % data_file ]
262+ 'covimerage: Running cmd: true (in %s)' % str (os .getcwd ()),
263+ 'covimerage: Parsing profile file %s.' % tmp_profile_fname ,
264+ 'covimerage: Writing coverage file %s.' % data_file ]
265265
266266 # Same, but to some file.
267267 ofname = str (tmpdir .join ('ofname' ))
@@ -270,9 +270,9 @@ def test_cli_run_report_fd(capfd, tmpdir, devnull):
270270 assert exit_code == 0 , err
271271 assert out == ''
272272 assert err .splitlines () == [
273- 'Running cmd: true (in %s)' % str (os .getcwd ()),
274- 'Parsing profile file %s.' % tmp_profile_fname ,
275- 'Writing coverage file %s.' % data_file ]
273+ 'covimerage: Running cmd: true (in %s)' % str (os .getcwd ()),
274+ 'covimerage: Parsing profile file %s.' % tmp_profile_fname ,
275+ 'covimerage: Writing coverage file %s.' % data_file ]
276276 assert open (ofname ).read ().splitlines () == [
277277 'Name Stmts Miss Cover' ,
278278 '----------------------------------------------------------------' ,
@@ -295,14 +295,14 @@ def test_cli_call(capfd):
295295 # click after 6.7 (9cfea14) includes: 'Try "covimerage --help" for help.'
296296 assert err_lines [- 2 :] == [
297297 '' ,
298- 'Error: No such command "file not found".' ]
298+ 'covimerage: Error: No such command "file not found".' ]
299299 assert out == ''
300300
301301 assert call (['covimerage' , 'write_coverage' , 'file not found' ]) == 2
302302 out , err = capfd .readouterr ()
303303 err_lines = err .splitlines ()
304304 assert err_lines [- 1 ] == (
305- 'Error: Invalid value for "%s": Could not open file: file not found: No such file or directory' % (
305+ 'covimerage: Error: Invalid value for "%s": Could not open file: file not found: No such file or directory' % (
306306 "profile_file" if click .__version__ < '7.0' else "[PROFILE_FILE]..." ,))
307307 assert out == ''
308308
@@ -312,38 +312,38 @@ def test_cli_call_verbosity_fd(capfd):
312312 out , err = capfd .readouterr ()
313313 assert out == ''
314314 assert err .splitlines () == [
315- 'Not writing coverage file: no data to report!' ,
316- 'Error: No data to report.' ]
315+ 'covimerage: Not writing coverage file: no data to report!' ,
316+ 'covimerage: Error: No data to report.' ]
317317
318318 assert call (['covimerage' , '-v' , 'write_coverage' , os .devnull ]) == 1
319319 out , err = capfd .readouterr ()
320320 assert out == ''
321321 assert err .splitlines () == [
322- 'Parsing file: /dev/null' ,
323- 'source_files: []' ,
324- 'Not writing coverage file: no data to report!' ,
325- 'Error: No data to report.' ]
322+ 'covimerage: Parsing file: /dev/null' ,
323+ 'covimerage: source_files: []' ,
324+ 'covimerage: Not writing coverage file: no data to report!' ,
325+ 'covimerage: Error: No data to report.' ]
326326
327327 assert call (['covimerage' , '-vvvv' , 'write_coverage' , os .devnull ]) == 1
328328 out , err = capfd .readouterr ()
329329 assert out == ''
330330 assert err .splitlines () == [
331- 'Parsing file: /dev/null' ,
332- 'source_files: []' ,
333- 'Not writing coverage file: no data to report!' ,
334- 'Error: No data to report.' ]
331+ 'covimerage: Parsing file: /dev/null' ,
332+ 'covimerage: source_files: []' ,
333+ 'covimerage: Not writing coverage file: no data to report!' ,
334+ 'covimerage: Error: No data to report.' ]
335335
336336 assert call (['covimerage' , '-vq' , 'write_coverage' , os .devnull ]) == 1
337337 out , err = capfd .readouterr ()
338338 assert out == ''
339339 assert err .splitlines () == [
340- 'Not writing coverage file: no data to report!' ,
341- 'Error: No data to report.' ]
340+ 'covimerage: Not writing coverage file: no data to report!' ,
341+ 'covimerage: Error: No data to report.' ]
342342
343343 assert call (['covimerage' , '-qq' , 'write_coverage' , os .devnull ]) == 1
344344 out , err = capfd .readouterr ()
345345 assert out == ''
346- assert err == 'Error: No data to report.\n '
346+ assert err == 'covimerage: Error: No data to report.\n '
347347
348348
349349def test_cli_writecoverage_without_data (runner ):
@@ -641,7 +641,7 @@ def test_run_handles_exit_code_from_python_fd(capfd):
641641 ret = call (['covimerage' , 'run' ,
642642 'python' , '-c' , 'print("output"); import sys; sys.exit(42)' ])
643643 out , err = capfd .readouterr ()
644- assert 'Error: Command exited non-zero: 42.' in err .splitlines ()
644+ assert 'covimerage: Error: Command exited non-zero: 42.' in err .splitlines ()
645645 assert out == 'output\n '
646646 assert ret == 42
647647
@@ -652,7 +652,7 @@ def test_run_handles_exit_code_from_python_pty_fd(capfd):
652652 "import pty; pty.spawn(['/bin/sh', '-c', "
653653 "'printf output; exit 42'])" ])
654654 out , err = capfd .readouterr ()
655- assert ('Error: The profile file (/not/used) has not been created.' in
655+ assert ('covimerage: Error: The profile file (/not/used) has not been created.' in
656656 err .splitlines ())
657657 assert out == 'output'
658658 assert ret == 1
0 commit comments