From c337c5c6cd488b24225d8363d77480f5032e0629 Mon Sep 17 00:00:00 2001 From: Thomas Reimonn Date: Wed, 3 Apr 2024 10:00:36 -0400 Subject: [PATCH] tests --- tests/test_filters.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/test_filters.py b/tests/test_filters.py index 9c25c4f..1daff6b 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -194,12 +194,15 @@ def test_negation(hsapiens108): assert result.shape[0] == 22894 -def test_seqs_as_int(hsapiens108): +@pytest.mark.parametrize("backend", ["sqlite", "duckdb"]) +def test_seqs_as_int(backend): + hsapiens108 = gf.ensembl.annotation("Hsapiens", 108, backend=backend) + result_w_int = hsapiens108.genes(filter=filters.SeqNameFilter(1)) result_w_str = hsapiens108.genes(filter=filters.SeqNameFilter("1")) pd.testing.assert_frame_equal( - result_w_int.sort_values(by="gene_id").reset_index(drop=True), - result_w_str.sort_values(by="gene_id").reset_index(drop=True), + result_w_int, + result_w_str, ) result_w_ints = hsapiens108.genes(filter=filters.SeqNameFilter([1, 2])) @@ -207,10 +210,10 @@ def test_seqs_as_int(hsapiens108): result_w_mixed = hsapiens108.genes(filter=filters.SeqNameFilter([1, "2"])) pd.testing.assert_frame_equal( - result_w_ints.sort_values(by="gene_id").reset_index(drop=True), - result_w_strs.sort_values(by="gene_id").reset_index(drop=True), + result_w_ints, + result_w_strs, ) pd.testing.assert_frame_equal( - result_w_ints.sort_values(by="gene_id").reset_index(drop=True), - result_w_mixed.sort_values(by="gene_id").reset_index(drop=True), + result_w_ints, + result_w_mixed, )