File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 11"""Settings for testing fooof."""
22
33import os
4-
5- # Use importlib to get package related paths, importing depending on Python version
6- # Note: can drop if/else when support goes to >= 3.9 (see: https://stackoverflow.com/a/75503824)
7- import sys
8- if sys .version_info >= (3 , 9 ):
9- import importlib .resources as importlib_resources
10- else :
11- import importlib_resources
4+ from pathlib import Path
125
136###################################################################################################
147###################################################################################################
158
169# Path Settings
17- BASE_TEST_FILE_PATH = importlib_resources .files (__name__ .split ('.' )[0 ]) / 'tests/test_files'
18- TEST_DATA_PATH = os .path .join (BASE_TEST_FILE_PATH , 'data' )
19- TEST_REPORTS_PATH = os .path .join (BASE_TEST_FILE_PATH , 'reports' )
20- TEST_PLOTS_PATH = os .path .join (BASE_TEST_FILE_PATH , 'plots' )
10+ TESTS_PATH = Path (os .path .abspath (os .path .dirname (__file__ )))
11+ BASE_TEST_FILE_PATH = TESTS_PATH / 'test_files'
12+ TEST_DATA_PATH = BASE_TEST_FILE_PATH / 'data'
13+ TEST_REPORTS_PATH = BASE_TEST_FILE_PATH / 'reports'
14+ TEST_PLOTS_PATH = BASE_TEST_FILE_PATH / 'plots'
You can’t perform that action at this time.
0 commit comments