From b304535250c8199ea489c842f095c999abe6b668 Mon Sep 17 00:00:00 2001 From: "Philipp A." Date: Thu, 26 Sep 2024 17:00:42 +0200 Subject: [PATCH] Move test helpers (#267) * Move test helpers * specify GPU marker --------- Co-authored-by: Severin Dicks <37635888+Intron7@users.noreply.github.com> --- pyproject.toml | 10 +++++++++- .../__init__.py => src/rapids_singlecell/_testing.py | 0 tests/test_aggregated.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) rename tests/_helpers/__init__.py => src/rapids_singlecell/_testing.py (100%) diff --git a/pyproject.toml b/pyproject.toml index 6344e29c..21604dc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,11 +87,19 @@ lint.ignore = [ "src/rapids_singlecell/decoupler_gpu/_method_mlm.py" = ["PLR0917"] "src/rapids_singlecell/decoupler_gpu/_method_wsum.py" = ["PLR0917"] - [tool.ruff.lint.isort] known-first-party = ["rapids_singlecell"] required-imports = ["from __future__ import annotations"] +[tool.pytest.ini_options] +addopts = [ + "--import-mode=importlib", + "--strict-markers", +] +markers = [ + "gpu: tests that use a GPU (currently unused, but needs to be specified here as we import anndata.tests.helpers, which uses it)", +] + [tool.hatch.envs.hatch-test] features = ["test", "rapids12"] diff --git a/tests/_helpers/__init__.py b/src/rapids_singlecell/_testing.py similarity index 100% rename from tests/_helpers/__init__.py rename to src/rapids_singlecell/_testing.py diff --git a/tests/test_aggregated.py b/tests/test_aggregated.py index 49d8cbdd..fa0d3b13 100644 --- a/tests/test_aggregated.py +++ b/tests/test_aggregated.py @@ -6,7 +6,6 @@ import pandas as pd import pytest import scanpy as sc -from _helpers import ARRAY_TYPES_MEM from anndata.tests.helpers import assert_equal from packaging.version import Version from scanpy._utils import _resolve_axis @@ -14,6 +13,7 @@ from scipy.sparse import csr_matrix import rapids_singlecell as rsc +from rapids_singlecell._testing import ARRAY_TYPES_MEM @pytest.fixture