Skip to content

Commit d37417a

Browse files
committed
tests/test_mies_nwb_pipeline_output.py: Avoid using the pkg_resources module
This is removed in python 3.12. We can leverage the importlib.resources module introduced in python 3.9 instead.
1 parent 2045f47 commit d37417a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_mies_nwb_pipeline_output.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import os
66
import ipfx.json_utilities as ju
77
from ipfx.bin.run_pipeline import run_pipeline
8-
from pkg_resources import resource_filename
8+
import importlib.resources
99
from dictdiffer import diff
1010

1111

12-
TEST_SPECIMENS_FILE = resource_filename(__name__, 'test_mies_nwb2_specimens.csv')
13-
14-
test_specimens = pd.read_csv(TEST_SPECIMENS_FILE, sep=" ")
12+
ref = importlib.resources.files('ipfx') / '../tests/test_mies_nwb2_specimens.csv'
13+
with importlib.resources.as_file(ref) as path:
14+
test_specimens = pd.read_csv(path, sep=" ")
1515
test_specimens_params = [tuple(sp) for sp in test_specimens.values]
1616

1717

0 commit comments

Comments
 (0)