13 lines
344 B
Python
13 lines
344 B
Python
"""Pytest 根配置:保证测试运行时 backend 包根目录在 sys.path 中。
|
|
|
|
运行方式(容器内,使用项目 venv):
|
|
cd /app/backend/python
|
|
/app/backend/python/.venv/bin/python -m pytest
|
|
"""
|
|
import os
|
|
import sys
|
|
|
|
ROOT = os.path.dirname(os.path.abspath(__file__))
|
|
if ROOT not in sys.path:
|
|
sys.path.insert(0, ROOT)
|