diff --git a/src/python/tests/test_gather.py b/src/python/tests/test_gather.py index d0376a02..5d4c4108 100644 --- a/src/python/tests/test_gather.py +++ b/src/python/tests/test_gather.py @@ -58,7 +58,6 @@ def test_simple(runtmp, zip_against): assert keys == {'query_filename', 'query_name', 'query_md5', 'match_name', 'match_md5', 'rank', 'intersect_bp'} - @pytest.mark.parametrize('zip_against', [False, True]) def test_simple_with_prefetch(runtmp, zip_against): # test basic execution! @@ -135,7 +134,7 @@ def test_bad_query(runtmp, capfd, zip_against): # query doesn't need to be a sig anymore - sig, zip, or pathlist welcome # as long as there's only one sketch that matches params - make_file_list(query, [sig2,sig47]) # [sig2] + make_file_list(query, [sig2,sig47]) make_file_list(against_list, [sig2, sig47, sig63]) if zip_against: @@ -161,11 +160,7 @@ def test_missing_against(runtmp, capfd, zip_against): query = get_test_data('SRR606249.sig.gz') against_list = runtmp.output('against.txt') - sig2 = get_test_data('2.fa.sig.gz') - sig47 = get_test_data('47.fa.sig.gz') - sig63 = get_test_data('63.fa.sig.gz') - - #make_file_list(against_list, [sig2, sig47, sig63]) + # don't make against list if zip_against: against_list = runtmp.output('against.zip') @@ -207,7 +202,6 @@ def test_sig_against(runtmp, capfd): assert keys == {'query_filename', 'query_name', 'query_md5', 'match_name', 'match_md5', 'rank', 'intersect_bp'} - def test_bad_against(runtmp, capfd): # test bad 'against' file - in this case, one containing a bad filename. query = get_test_data('SRR606249.sig.gz') diff --git a/src/python/tests/test_index.py b/src/python/tests/test_index.py index d228bbcf..053b11e7 100644 --- a/src/python/tests/test_index.py +++ b/src/python/tests/test_index.py @@ -215,7 +215,6 @@ def test_index_zipfile_repeated_md5sums(runtmp, capfd): captured = capfd.readouterr() print(captured.err) - # assert 'Found 3 filepaths' in captured.err assert 'index is done' in runtmp.last_result.err diff --git a/src/python/tests/test_multigather.py b/src/python/tests/test_multigather.py index 1f96eed1..33ed00d6 100644 --- a/src/python/tests/test_multigather.py +++ b/src/python/tests/test_multigather.py @@ -182,8 +182,6 @@ def test_missing_querylist(runtmp, capfd, indexed, zip_query): captured = capfd.readouterr() print(captured.err) - - # assert 'Error: failed to load query' in captured.err assert 'Error: No such file or directory' in captured.err @@ -313,8 +311,6 @@ def test_nomatch_query(runtmp, capfd, indexed, zip_query): captured = capfd.readouterr() print(captured.err) - - # assert "WARNING: no compatible sketches in path " in captured.err assert "WARNING: skipped 1 query paths - no compatible signatures." in captured.err @@ -424,7 +420,6 @@ def test_bad_against_2(runtmp, capfd, zip_query): def test_empty_against(runtmp, capfd): - # like fastgather - exit gracefully. # test bad 'against' file - in this case, an empty one query = get_test_data('SRR606249.sig.gz') query_list = runtmp.output('query.txt') diff --git a/src/python/tests/test_multisearch.py b/src/python/tests/test_multisearch.py index a7b09931..976c8a59 100644 --- a/src/python/tests/test_multisearch.py +++ b/src/python/tests/test_multisearch.py @@ -133,7 +133,6 @@ def test_missing_query(runtmp, capfd, zip_query): sig47 = get_test_data('47.fa.sig.gz') sig63 = get_test_data('63.fa.sig.gz') - #make_file_list(query_list, [sig2, sig47, sig63]) make_file_list(against_list, [sig2, sig47, sig63]) output = runtmp.output('out.csv') @@ -173,6 +172,7 @@ def test_sig_query(runtmp, capfd): df = pandas.read_csv(output) assert len(df) == 1 + def test_bad_query(runtmp, capfd): # test with a bad query list (a missing file) query_list = runtmp.output('query.txt') @@ -238,7 +238,7 @@ def test_missing_against(runtmp, capfd, zip_db): # do not create against_list if zip_db: - #.zip but don't create the file + #specify .zip but don't create the file against_list = runtmp.output('db.zip') output = runtmp.output('out.csv') @@ -263,7 +263,6 @@ def test_sig_against(runtmp, capfd): sig63 = get_test_data('63.fa.sig.gz') make_file_list(query_list, [sig2, sig47, sig63]) - #make_file_list(against_list, [sig2, sig47, sig63]) output = runtmp.output('out.csv') @@ -277,6 +276,7 @@ def test_sig_against(runtmp, capfd): df = pandas.read_csv(output) assert len(df) == 1 + def test_bad_against(runtmp, capfd): # test with a bad against list (a missing file) query_list = runtmp.output('query.txt') diff --git a/src/python/tests/test_pairwise.py b/src/python/tests/test_pairwise.py index 0dd67c05..2207c282 100644 --- a/src/python/tests/test_pairwise.py +++ b/src/python/tests/test_pairwise.py @@ -114,7 +114,6 @@ def test_simple_threshold(runtmp, zip_query): assert len(df) == 1 - def test_sig_query(runtmp, capfd): # sig query is ok now, but fails bc only one sig sig2 = get_test_data('2.fa.sig.gz') @@ -152,7 +151,6 @@ def test_bad_query(runtmp, capfd): def test_bad_query_2(runtmp, capfd): # test with a bad query (a .sig.gz file renamed as zip file) - sig2 = get_test_data('2.fa.sig.gz') sig47 = get_test_data('47.fa.sig.gz') sig63 = get_test_data('63.fa.sig.gz') @@ -274,11 +272,6 @@ def test_load_only_one_bug(runtmp, capfd, zip_db): assert not 'WARNING: no compatible sketches in path ' in captured.err - - - - - @pytest.mark.parametrize("zip_query", [False, True]) def test_md5(runtmp, zip_query): # test that md5s match what was in the original files, not downsampled etc. @@ -314,8 +307,6 @@ def test_md5(runtmp, zip_query): print(md5s) - - def test_simple_prot(runtmp): # test basic execution with protein sigs sigs = get_test_data('protein.zip') @@ -368,7 +359,6 @@ def test_simple_prot(runtmp): assert intersect_hashes == 342 - def test_simple_dayhoff(runtmp): # test basic execution with dayhoff sigs sigs = get_test_data('dayhoff.zip') diff --git a/src/python/tests/test_search.py b/src/python/tests/test_search.py index c6c49c95..f84db833 100644 --- a/src/python/tests/test_search.py +++ b/src/python/tests/test_search.py @@ -229,7 +229,7 @@ def test_missing_query(runtmp, capfd, indexed, zip_query): sig47 = get_test_data('47.fa.sig.gz') sig63 = get_test_data('63.fa.sig.gz') - #make_file_list(query_list, [sig2, sig47, sig63]) + #make_file_list(query_list, [sig2, sig47, sig63]) # don't make query make_file_list(against_list, [sig2, sig47, sig63]) if indexed: @@ -266,15 +266,9 @@ def test_sig_query(runtmp, capfd, indexed): output = runtmp.output('out.csv') - # with pytest.raises(utils.SourmashCommandFailed): runtmp.sourmash('scripts', 'manysearch', sig2, against_list, '-o', output) - # captured = capfd.readouterr() - # print(captured.err) - - # assert 'Error: invalid line in fromfile' in captured.err - @pytest.mark.parametrize("indexed", [False, True]) def test_bad_query_2(runtmp, capfd, indexed): @@ -363,7 +357,6 @@ def test_nomatch_against(runtmp, capfd): sig2 = get_test_data('2.fa.sig.gz') sig47 = get_test_data('47.fa.sig.gz') sig63 = get_test_data('63.fa.sig.gz') - # nomatch_sketch = get_test_data('genome-s11.fa.gz.sig') nomatch_sketch = get_test_data('SRR606249.sig.gz') make_file_list(query_list, [sig2, sig47, sig63]) @@ -371,7 +364,6 @@ def test_nomatch_against(runtmp, capfd): output = runtmp.output('out.csv') - # with pytest.raises(utils.SourmashCommandFailed): runtmp.sourmash('scripts', 'manysearch', query_list, against_list, '-o', output) @@ -420,7 +412,6 @@ def test_empty_query(runtmp, indexed, capfd): output = runtmp.output('out.csv') - # with pytest.raises(utils.SourmashCommandFailed): runtmp.sourmash('scripts', 'manysearch', query_list, against_list, '-o', output)