@@ -205,17 +205,17 @@ def test_query_arithmethic(tmp_path, expr):
205
205
206
206
207
207
@pytest .mark .parametrize (
208
- "expr" ,
208
+ ( "expr" , "expected" ) ,
209
209
[
210
210
# Check boolean logic evaluation. Will evaluate this with
211
211
# 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 ),
216
216
],
217
217
)
218
- def test_query_logic_precendence (tmp_path , expr ):
218
+ def test_query_logic_precendence (tmp_path , expr , expected ):
219
219
220
220
args = r"query -f '%POS\n'" + f" -i 'POS=112 && ({ expr } )'"
221
221
vcf_name = "sample.vcf.gz"
@@ -227,7 +227,7 @@ def test_query_logic_precendence(tmp_path, expr):
227
227
228
228
assert vcztools_output == bcftools_output
229
229
num_lines = len (list (vcztools_output .splitlines ()))
230
- assert num_lines in [ 0 , 1 ]
230
+ assert num_lines == int ( expected )
231
231
232
232
233
233
@pytest .mark .parametrize (
0 commit comments