Skip to content

Commit 291800b

Browse files
tomwhitejeromekelleher
authored andcommitted
Fixes for click 8.2.0
1 parent 405c08d commit 291800b

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

tests/test_bcftools_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def run_bcftools(args: str, expect_error=False) -> tuple[str, str]:
2626

2727
def run_vcztools(args: str, expect_error=False) -> tuple[str, str]:
2828
"""Run run_vcztools and return stdout and stderr as a pair of strings."""
29-
runner = ct.CliRunner(mix_stderr=False)
29+
runner = ct.CliRunner()
3030
result = runner.invoke(
3131
cli.vcztools_main,
3232
args,

tests/test_cli.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_view_unsupported_output_suffix(self, tmp_path, vcz_path, suffix):
4545

4646
def test_view_good_path(self, tmp_path, vcz_path):
4747
output_path = tmp_path / "tmp.vcf"
48-
runner = ct.CliRunner(mix_stderr=False)
48+
runner = ct.CliRunner()
4949
result = runner.invoke(
5050
cli.vcztools_main,
5151
f"view --no-version {vcz_path} -o {output_path}",
@@ -56,7 +56,7 @@ def test_view_good_path(self, tmp_path, vcz_path):
5656
assert output_path.exists()
5757

5858
def test_view_write_directory(self, tmp_path, vcz_path):
59-
runner = ct.CliRunner(mix_stderr=False)
59+
runner = ct.CliRunner()
6060
result = runner.invoke(
6161
cli.vcztools_main,
6262
f"view --no-version {vcz_path} -o {tmp_path}",
@@ -67,7 +67,7 @@ def test_view_write_directory(self, tmp_path, vcz_path):
6767
assert "Is a directory" in result.stderr
6868

6969
def test_view_write_pipe(self, tmp_path, vcz_path):
70-
runner = ct.CliRunner(mix_stderr=False)
70+
runner = ct.CliRunner()
7171
result = runner.invoke(
7272
cli.vcztools_main,
7373
f"view --no-version {vcz_path} -o {tmp_path}",
@@ -104,7 +104,7 @@ def test_broken_pipe(mocked_dup2, mocked_exit, tmp_path):
104104

105105
class TestQuery:
106106
def test_format_required(self, vcz_path):
107-
runner = ct.CliRunner(mix_stderr=False)
107+
runner = ct.CliRunner()
108108
result = runner.invoke(
109109
cli.vcztools_main,
110110
f"query {vcz_path} ",
@@ -115,7 +115,7 @@ def test_format_required(self, vcz_path):
115115
assert len(result.stderr) > 0
116116

117117
def test_path_required(self):
118-
runner = ct.CliRunner(mix_stderr=False)
118+
runner = ct.CliRunner()
119119
result = runner.invoke(
120120
cli.vcztools_main,
121121
"query --format=POS ",
@@ -152,7 +152,7 @@ def test_nrecords(self, vcz_path):
152152
assert list(result.splitlines()) == ["9"]
153153

154154
def test_stats_and_nrecords(self, vcz_path):
155-
runner = ct.CliRunner(mix_stderr=False)
155+
runner = ct.CliRunner()
156156
result = runner.invoke(
157157
cli.vcztools_main,
158158
f"index -ns {vcz_path}",
@@ -164,7 +164,7 @@ def test_stats_and_nrecords(self, vcz_path):
164164
assert "Expected only one of --stats or --nrecords options" in result.stderr
165165

166166
def test_no_stats_or_nrecords(self, vcz_path):
167-
runner = ct.CliRunner(mix_stderr=False)
167+
runner = ct.CliRunner()
168168
result = runner.invoke(
169169
cli.vcztools_main,
170170
f"index {vcz_path}",
@@ -177,18 +177,18 @@ def test_no_stats_or_nrecords(self, vcz_path):
177177

178178

179179
def test_top_level():
180-
runner = ct.CliRunner(mix_stderr=False)
180+
runner = ct.CliRunner()
181181
result = runner.invoke(
182182
cli.vcztools_main,
183183
catch_exceptions=False,
184184
)
185-
assert result.exit_code == 0
186-
assert len(result.stdout) > 0
187-
assert len(result.stderr) == 0
185+
assert result.exit_code != 0
186+
assert len(result.stdout) == 0
187+
assert len(result.stderr) > 0
188188

189189

190190
def test_version():
191-
runner = ct.CliRunner(mix_stderr=False)
191+
runner = ct.CliRunner()
192192
result = runner.invoke(cli.vcztools_main, ["--version"], catch_exceptions=False)
193193
s = f"version {provenance.__version__}\n"
194194
assert result.stdout.endswith(s)

tests/test_plink_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_conversion_identical(tmp_path, args, vcf_file):
4646
assert result.returncode == 0
4747

4848
cmd = f"view-plink1 {vcz.absolute()} {args}"
49-
runner = ct.CliRunner(mix_stderr=False)
49+
runner = ct.CliRunner()
5050
with runner.isolated_filesystem(tmp_path) as working_dir:
5151
vcz_workdir = pathlib.Path(working_dir)
5252
result = runner.invoke(cli.vcztools_main, cmd, catch_exceptions=False)

vcztools/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ def query(path, output, list_samples, format, include, exclude):
186186
@click.option(
187187
"-G",
188188
"--drop-genotypes",
189-
type=bool,
190189
is_flag=True,
191190
help="Drop genotypes.",
192191
)

0 commit comments

Comments
 (0)