Skip to content

Commit 14e7201

Browse files
Improve validation test on precedence
1 parent 4d997aa commit 14e7201

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_bcftools_validation.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,17 @@ def test_query_arithmethic(tmp_path, expr):
205205

206206

207207
@pytest.mark.parametrize(
208-
"expr",
208+
("expr", "expected"),
209209
[
210210
# Check boolean logic evaluation. Will evaluate this with
211211
# POS=112, so POS=112 is True and POS!=112 is False
212-
"POS==112 || POS!=112", # True
213-
"POS==112 && POS!=112", # True
214-
"POS==112 || POS!=112 && POS!= 112", # True
215-
"(POS==112 || POS!=112) && POS!= 112", # False
212+
("POS==112 || POS!=112", True),
213+
("POS==112 && POS!=112", False),
214+
("POS==112 || POS!=112 && POS!= 112", True),
215+
("(POS==112 || POS!=112) && POS!= 112", False),
216216
],
217217
)
218-
def test_query_logic_precendence(tmp_path, expr):
218+
def test_query_logic_precendence(tmp_path, expr, expected):
219219

220220
args = r"query -f '%POS\n'" + f" -i 'POS=112 && ({expr})'"
221221
vcf_name = "sample.vcf.gz"
@@ -227,7 +227,7 @@ def test_query_logic_precendence(tmp_path, expr):
227227

228228
assert vcztools_output == bcftools_output
229229
num_lines = len(list(vcztools_output.splitlines()))
230-
assert num_lines in [0, 1]
230+
assert num_lines == int(expected)
231231

232232

233233
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)