Commit ce3ed771 ce3ed77124892d38b8ec66a69afb03b086b88f61 by chenjing

兼容异常场景

1 parent 3f7d769d
......@@ -18,7 +18,7 @@ def should_run_in_env(env_scope, current_env):
判断用例是否应在当前环境执行
env_scope 格式:
- 空'all' → 所有环境执行
- 空、None、'None'、'all' → 所有环境执行
- 'test' → 仅测试环境
- 'uat' → 仅UAT环境
- 'prod' → 仅生产环境
......@@ -27,7 +27,8 @@ def should_run_in_env(env_scope, current_env):
"""
if not env_scope or env_scope.strip() == '':
return True
if env_scope.strip().lower() == 'all':
# 处理字符串"None"或"none"的情况
if str(env_scope).strip().lower() in ['none', 'all']:
return True
allowed_envs = [e.strip() for e in env_scope.split(',')]
return current_env in allowed_envs
......