Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dev = [
"psycopg2-binary",
"ruff==0.12.1",
]
tests = ["pytest", "pytest-cov", "pytest-asyncio==0.18.3", "mock"]
tests = ["pytest", "pytest-cov", "pytest-asyncio", "mock"]
docs = [
"sphinx==6.1.3",
"sphinx-autodoc-typehints==1.22.0",
Expand Down Expand Up @@ -81,6 +81,9 @@ build-backend = "setuptools.build_meta"
"cool_seq_tool.resources" = ["transcript_mapping.tsv"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
asyncio_default_test_loop_scope = "session"
addopts = "--cov=src --cov-report term-missing"
testpaths = ["tests"]

Expand Down
10 changes: 0 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Provide utilities for test cases."""

import asyncio

import pytest

from cool_seq_tool import CoolSeqTool
Expand All @@ -10,14 +8,6 @@
from cool_seq_tool.sources.uta_database import GenomicAlnData, GenomicTxMetadata


@pytest.fixture(scope="session")
def event_loop(request):
"""Create an instance of the default event loop for each test case."""
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()


@pytest.fixture(scope="session")
def test_cool_seq_tool():
"""Create CoolSeqTool test fixture"""
Expand Down
10 changes: 5 additions & 5 deletions tests/mappers/test_mane_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ async def test_g_to_c(

def test_set_liftover(test_mane_transcript, genomic_tx_data):
"""Test that _set_liftover works correctly."""
cpy = genomic_tx_data.copy(deep=True)
expected = genomic_tx_data.copy(deep=True)
cpy = genomic_tx_data.model_copy(deep=True)
expected = genomic_tx_data.model_copy(deep=True)
test_mane_transcript._set_liftover(cpy, "alt_pos_range", "chr7", "GRCh38")
expected.alt_pos_range = (140739811, 140739946)
assert cpy == expected
Expand All @@ -311,8 +311,8 @@ def test_set_liftover(test_mane_transcript, genomic_tx_data):
@pytest.mark.asyncio
async def test_liftover_to_38(test_mane_transcript, genomic_tx_data):
"""Test that liftover_to_38 works correctly."""
cpy = genomic_tx_data.copy(deep=True)
expected = genomic_tx_data.copy(deep=True)
cpy = genomic_tx_data.model_copy(deep=True)
expected = genomic_tx_data.model_copy(deep=True)
await test_mane_transcript._liftover_to_38(cpy)
expected.alt_ac = "NC_000007.14"
expected.alt_pos_change_range = (140739903, 140739903)
Expand Down Expand Up @@ -675,7 +675,7 @@ async def test_g_to_grch38(test_mane_transcript, grch38_egfr, grch38_braf):
resp = await test_mane_transcript.g_to_grch38(
"NC_000007.13", 55259515, 55259515, get_mane_genes=False
)
grch38_egfr_no_genes = grch38_egfr.copy()
grch38_egfr_no_genes = grch38_egfr.model_copy()
grch38_egfr_no_genes.mane_genes = []
assert resp == grch38_egfr_no_genes

Expand Down