aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/utils
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2023-09-29 14:12:18 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2023-09-29 14:36:57 +0200
commitf430ee4d9ef63f104dde63710fce7f8fa3c61591 (patch)
tree9e9978c12b49e5717a8ea279197fa200100b6d7b /xtesting/utils
parent781fc313c1c59018edb892ff0423963191781592 (diff)
Upgrade pylint and fix latest warnings
Change-Id: I8b9e4b663a12ac9be18fded2d7b4e4b38428fa9f Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/utils')
-rw-r--r--xtesting/utils/constants.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/xtesting/utils/constants.py b/xtesting/utils/constants.py
index f5e29e0d..12f1fde3 100644
--- a/xtesting/utils/constants.py
+++ b/xtesting/utils/constants.py
@@ -12,7 +12,7 @@
import os
import sys
-import pkg_resources
+import importlib.resources
ENV_FILE = '/var/lib/xtesting/conf/env_file'
@@ -20,14 +20,21 @@ XTESTING_PATHES = [
"~/.xtesting", "/etc/xtesting", os.path.join(sys.prefix + "/etc/xtesting")]
TESTCASE_DESCRIPTION = 'testcases.yaml'
-TESTCASE_DESCRIPTION_DEFAULT = pkg_resources.resource_filename(
- 'xtesting', f'ci/{TESTCASE_DESCRIPTION}')
+
+with importlib.resources.as_file(
+ importlib.resources.files('xtesting') /
+ f'ci/{TESTCASE_DESCRIPTION}') as path:
+ TESTCASE_DESCRIPTION_DEFAULT = path
RESULTS_DIR = '/var/lib/xtesting/results'
LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.log')
DEBUG_LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.debug.log')
-INI_PATH_DEFAULT = pkg_resources.resource_filename(
- 'xtesting', 'ci/logging.ini')
-DEBUG_INI_PATH_DEFAULT = pkg_resources.resource_filename(
- 'xtesting', 'ci/logging.debug.ini')
+with importlib.resources.as_file(
+ importlib.resources.files('xtesting') /
+ 'ci/logging.ini') as path:
+ INI_PATH_DEFAULT = path
+with importlib.resources.as_file(
+ importlib.resources.files('xtesting') /
+ 'ci/logging.debug.ini') as path:
+ DEBUG_INI_PATH_DEFAULT = path