Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
chenjing
/
api-test
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
ce3ed771
...
ce3ed77124892d38b8ec66a69afb03b086b88f61
authored
2026-01-21 15:13:11 +0800
by
chenjing
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
兼容异常场景
1 parent
3f7d769d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
api_test.py
api_test.py
View file @
ce3ed77
...
...
@@ -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
...
...
Please
register
or
sign in
to post a comment