15 lines
465 B
Python
15 lines
465 B
Python
"""测试引导模块。
|
||
|
||
将 ``src`` 目录加入 ``sys.path``,使 ``python -m unittest discover -s tests -v``
|
||
在未安装包的情况下也能直接运行(src-layout 项目无需额外设置 PYTHONPATH)。
|
||
每个测试模块顶部 ``import _bootstrap`` 即可。
|
||
"""
|
||
from __future__ import annotations
|
||
|
||
import os
|
||
import sys
|
||
|
||
_SRC = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "src")
|
||
if _SRC not in sys.path:
|
||
sys.path.insert(0, _SRC)
|