测试组/脚本/造数脚本2/齐鲁/pda更新笼位.py
@@ -1,7 +1,5 @@
import sys
import os
# 将上一级目录加入模块搜索路径
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import asyncio
import aiohttp
import time
@@ -11,10 +9,17 @@
import pymysql
import random
from tqdm import tqdm
from Util.dingtalk_helper import DingTalkHelper
# 将上一级目录加入模块搜索路径
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
def get_parent_directory(file_path, levels=1):
    """获取指定层级的父目录"""
    path = os.path.abspath(file_path)
    for _ in range(levels):
        path = os.path.dirname(path)
    return path
parent_dir = get_parent_directory(__file__, 5)  # 获取上五级目录
sys.path.append(parent_dir)
from 测试组.脚本.造数脚本2.Util.dingtalk_helper import DingTalkHelper
# --- 配置 ---
ACCESS_TOKEN = '4625f6690acd9347fae5b3a05af598be63e73d604b933a9b3902425b8f136d4d'
@@ -253,7 +258,7 @@
        import importlib.util
        # 使用您提供的绝对路径
        report_path = 'H:\\项目\\造数脚本\\Util\\stress_test_report_generator.py'
        report_path = 'H:\\项目\\archive\\测试组\\脚本\\造数脚本2\\Util\\stress_test_report_generator.py'
        if os.path.exists(report_path):
            spec = importlib.util.spec_from_file_location('report_module', report_path)