Skip to content

Commit b992c1b

Browse files
committed
add benchmark test, work on #7
1 parent 27baa4c commit b992c1b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tests/data/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ BEDTOREGIONS='BEGIN{OFS=""}{print $$1,":",($$2+1),"-",$$3}'
4949
.PHONY: data clean
5050

5151

52-
data: $(RECALTABLE) $(RECALBAM) $(VARSITES)
52+
data: $(RECALTABLE) $(RECALBAM) $(VARSITES) $(FULLREADS)
5353

5454
clean:
5555
rm -f $(RECALTABLE) $(RECALBAM) $(VARSITES) $(FULLBAMNAME).bai \

tests/test_benchmark.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pytest
2+
import kbbq.main
3+
4+
def test_benchmarks_match(monkeypatch, capfd):
5+
"""
6+
This is pretty much a sanity check, so we should
7+
do a nocover and add more thorough tests later.
8+
"""
9+
import sys
10+
with monkeypatch.context() as m:
11+
m.setattr(sys, 'argv', [sys.argv[0]] + "benchmark -b tests/data/conf_regions.bam -r tests/data/ref.fa -v tests/data/conf_regions.vcf.gz --label=label --use-oq".split())
12+
kbbq.main.main()
13+
bam_captured = capfd.readouterr()
14+
15+
with monkeypatch.context() as m:
16+
m.setattr(sys, 'argv', [sys.argv[0]] + "benchmark -b tests/data/conf_regions.bam -r tests/data/ref.fa -v tests/data/conf_regions.vcf.gz --label=label -f tests/data/reads.fq".split())
17+
kbbq.main.main()
18+
fastq_captured = capfd.readouterr()
19+
assert bam_captured.out == fastq_captured.out

0 commit comments

Comments
 (0)