Skip to content

Commit

Permalink
add new type alias for db_factory fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
JAlvarezJarreta committed Sep 19, 2024
1 parent 02f9bf8 commit dbe2ef5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ensembl/utils/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os
from pathlib import Path
import re
from typing import Callable, Generator
from typing import Callable, Generator, TypeAlias

import pytest
from pytest import Config, FixtureRequest, Parser
Expand All @@ -30,6 +30,9 @@
from ensembl.utils.database import UnitTestDB


DBFactory: TypeAlias = Callable[[StrPath | None, str | None, MetaData | None], UnitTestDB]


def pytest_addoption(parser: Parser) -> None:
"""Registers argparse-style options for Ensembl's unit testing.
Expand Down Expand Up @@ -115,7 +118,7 @@ def _assert_files(result_path: StrPath, expected_path: StrPath) -> None:


@pytest.fixture(name="db_factory", scope="module")
def fixture_db_factory(request: FixtureRequest, data_dir: Path) -> Generator[Callable, None, None]:
def fixture_db_factory(request: FixtureRequest, data_dir: Path) -> Generator[DBFactory, None, None]:
"""Yields a unit test database factory.
Args:
Expand Down

0 comments on commit dbe2ef5

Please sign in to comment.