From 7175c792220743c85442d0dc8a77cd32881d3923 Mon Sep 17 00:00:00 2001 From: Cameron Smith Date: Tue, 13 Aug 2024 13:05:59 -0400 Subject: [PATCH] fix(tests): use importlib resources to refer to fixture data Signed-off-by: Cameron Smith --- src/pyrovelocity/tests/plots/conftest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyrovelocity/tests/plots/conftest.py b/src/pyrovelocity/tests/plots/conftest.py index 34a2f7dc5..18bbf29a2 100644 --- a/src/pyrovelocity/tests/plots/conftest.py +++ b/src/pyrovelocity/tests/plots/conftest.py @@ -1,3 +1,5 @@ +from importlib.resources import files + import pytest from pyrovelocity.io.serialization import load_anndata_from_json @@ -5,6 +7,7 @@ @pytest.fixture def adata_preprocessed(): - return load_anndata_from_json( - "src/pyrovelocity/tests/data/preprocessed_3_4.json" + fixture_file_path = ( + files("pyrovelocity.tests.data") / "preprocessed_3_4.json" ) + return load_anndata_from_json(fixture_file_path)