20 lines
547 B
Python
20 lines
547 B
Python
"""测试引导模块。
|
|
|
|
`python -m unittest discover -s tests -v` 启动时会把 `tests/` 目录置于
|
|
`sys.path` 首位,因此每个测试文件只需 `import _bootstrap` 即可把仓库的
|
|
`src/` 目录注入 `sys.path`,从而能够直接导入 `fault_log_analyzer` 包,
|
|
无需预先 `pip install -e .`。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
|
|
_SRC_DIR = os.path.abspath(
|
|
os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "src")
|
|
)
|
|
|
|
if _SRC_DIR not in sys.path:
|
|
sys.path.insert(0, _SRC_DIR)
|