We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b959da9 commit 5b2c0f6Copy full SHA for 5b2c0f6
sonic-chassisd/tests/test_dpu_chassisd.py
@@ -4,13 +4,21 @@
4
import pytest
5
import signal
6
import threading
7
-from imp import load_source
+import importlib
8
import re
9
10
from mock import MagicMock
11
from sonic_py_common import daemon_base
12
13
from .mock_platform import MockDpuChassis
14
+
15
+# Make scripts/ importable so `import chassisd` resolves
16
+_REPO_ROOT = os.path.dirname(os.path.dirname(__file__))
17
+_SCRIPTS_DIR = os.path.join(_REPO_ROOT, "scripts")
18
+if _SCRIPTS_DIR not in sys.path:
19
+ sys.path.insert(0, _SCRIPTS_DIR)
20
21
+chassisd = importlib.import_module("chassisd")
22
from chassisd import *
23
24
0 commit comments