Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
019e2019
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
019e2019
编写于
1月 08, 2020
作者:
Z
zhouwei25
提交者:
Tao Luo
1月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix diff_unittest.py of ci rule to avoid Misjudgment (#22113)
上级
e587bc62
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
11 deletion
+18
-11
tools/diff_unittest.py
tools/diff_unittest.py
+18
-11
未找到文件。
tools/diff_unittest.py
浏览文件 @
019e2019
...
@@ -2,23 +2,30 @@
...
@@ -2,23 +2,30 @@
import
difflib
import
difflib
import
sys
import
sys
with
open
(
sys
.
argv
[
1
],
'r'
)
as
f
:
try
:
origin
=
f
.
read
()
f1
=
open
(
sys
.
argv
[
1
],
'r'
)
origin
=
f1
.
read
()
origin
=
origin
.
splitlines
()
origin
=
origin
.
splitlines
()
except
:
sys
.
exit
(
0
)
else
:
f1
.
close
()
with
open
(
sys
.
argv
[
2
],
'r'
)
as
f
:
try
:
new
=
f
.
read
()
f2
=
open
(
sys
.
argv
[
2
],
'r'
)
new
=
f2
.
read
()
new
=
new
.
splitlines
()
new
=
new
.
splitlines
()
except
:
differ
=
difflib
.
Differ
()
sys
.
exit
(
0
)
result
=
differ
.
compare
(
origin
,
new
)
else
:
f2
.
close
()
error
=
False
error
=
False
diffs
=
[]
diffs
=
[]
for
each_diff
in
result
:
for
i
in
origin
:
if
each_diff
[
0
]
==
'-'
:
# delete unit test is not allowed
if
i
not
in
new
:
error
=
True
error
=
True
diffs
.
append
(
each_diff
)
diffs
.
append
(
i
)
'''
'''
If you delete the unit test, such as commenting it out,
If you delete the unit test, such as commenting it out,
please ask for approval of one RD below for passing CI:
please ask for approval of one RD below for passing CI:
...
@@ -27,4 +34,4 @@ please ask for approval of one RD below for passing CI:
...
@@ -27,4 +34,4 @@ please ask for approval of one RD below for passing CI:
'''
'''
if
error
:
if
error
:
for
each_diff
in
diffs
:
for
each_diff
in
diffs
:
print
(
each_diff
)
print
(
"- %s"
%
each_diff
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录