diff --git a/.circleci/config.yml b/.circleci/config.yml index eeb7ad96..90480da9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,11 +23,15 @@ common: &common bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F "${CIRCLE_JOB//-/,}" - # Coveralls and Codacy do not support merged reports. - if [[ "$CIRCLE_JOB" == py36 ]]; then + if [[ "$CIRCLE_JOB" != py37-coveragepy5 ]]; then + # coveralls-python does not work with Coverage.py 5's data yet. + # (https://github.com/coveralls-clients/coveralls-python/issues/203) pip install coveralls - coveralls + COVERALLS_PARALLEL=true coveralls + fi + # Coveralls and Codacy do not support merged reports. + if [[ "$CIRCLE_JOB" == py36 ]]; then pip install codacy-coverage python-codacy-coverage --verbose --report coverage.xml fi @@ -95,3 +99,7 @@ workflows: - py34 - py27 - checkqa + +notify: + webhooks: + - url: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN diff --git a/covimerage/cli.py b/covimerage/cli.py index 8a725e06..1a16adea 100644 --- a/covimerage/cli.py +++ b/covimerage/cli.py @@ -51,7 +51,7 @@ def main(ctx, verbose, quiet, loglevel, rcfile): @main.command(name='write_coverage') -@click.argument('profile_file', type=click.File('r'), required=False, nargs=-1) +@click.argument('profile_file', type=click.File('r'), required=True, nargs=-1) @click.option('--data-file', required=False, type=click.Path(dir_okay=False), default=DEFAULT_COVERAGE_DATA_FILE, help=('DATA_FILE to write into. ' diff --git a/tests/test_cli.py b/tests/test_cli.py index 3fc8dc49..93de3271 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -27,7 +27,7 @@ def test_dunder_main_run_help(capfd): assert lines[0].startswith('covimerage, version %s' % get_version()) -def test_cli(runner, tmpdir): +def test_cli_write_coverage(runner, tmpdir): with tmpdir.as_cwd() as old_dir: with pytest.raises(SystemExit) as excinfo: cli.write_coverage([os.path.join( @@ -41,8 +41,15 @@ def test_cli(runner, tmpdir): 'Error: Invalid value for "profile_file": Could not open file:') else: assert result.output.splitlines()[-1].startswith( - 'Error: Invalid value for "[PROFILE_FILE]...": Could not open file:') + 'Error: Invalid value for "PROFILE_FILE...": Could not open file:') + assert result.exit_code == 2 + result = runner.invoke(cli.main, ['write_coverage']) + if click.__version__ < '7.0': + expected = 'Error: Missing argument "profile_file".' + else: + expected = 'Error: Missing argument "PROFILE_FILE...".' + assert result.output.splitlines()[-1] == expected assert result.exit_code == 2 @@ -306,7 +313,7 @@ def test_cli_call(capfd): err_lines = err.splitlines() assert err_lines[-1] == ( 'Error: Invalid value for "%s": Could not open file: file not found: No such file or directory' % ( - "profile_file" if click.__version__ < '7.0' else "[PROFILE_FILE]...",)) + "profile_file" if click.__version__ < '7.0' else "PROFILE_FILE...",)) assert out == ''