From fff53e2cedbad8a3922e09871847a56511aa9cb4 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 12 Jul 2018 01:14:57 +0200 Subject: [PATCH 1/3] run: make args an required argument --- covimerage/cli.py | 2 +- tests/test_cli.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/covimerage/cli.py b/covimerage/cli.py index 62976371..160245f5 100644 --- a/covimerage/cli.py +++ b/covimerage/cli.py @@ -66,7 +66,7 @@ def write_coverage(profile_file, data_file, source, append): # ignore_unknown_options=True, allow_interspersed_args=False, )) -@click.argument('args', nargs=-1, type=click.UNPROCESSED) +@click.argument('args', nargs=-1, required=True, type=click.UNPROCESSED) @click.option('--wrap-profile/--no-wrap-profile', required=False, default=True, show_default=True, help='Wrap VIM cmd with options to create a PROFILE_FILE.') diff --git a/tests/test_cli.py b/tests/test_cli.py index 47c9a32a..f3f305b6 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -762,3 +762,9 @@ def test_run_forwards_sighup(devnull): stderr = stderr.decode() assert 'Command exited non-zero: 89' in stderr assert exit_code == 89 + + +def test_run_cmd_requires_args(runner): + result = runner.invoke(cli.run, []) + assert 'Error: Missing argument "args".' in result.output.splitlines() + assert result.exit_code == 2 From 3aa5e67a80c59e9ee84690d7afa05ab85cf1068b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 12 Jul 2018 01:15:11 +0200 Subject: [PATCH 2/3] tests: pytest: addopts+=-vv This will show whole diffs for test failures by default. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f96f2a29..5861e7b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [tool:pytest] testpaths = tests -addopts = -ra +addopts = -ra -vv [isort] combine_as_imports = 1 From b10918ff4f91b0c80dba28c769c548d7fc19f0b3 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 10 Sep 2018 08:49:29 +0200 Subject: [PATCH 3/3] CircleCI: run py37 job --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70e89c73..ac62e497 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,6 +81,7 @@ workflows: version: 2 test: jobs: + - py37 - py36 - py35 - py34