Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
19fdee9d
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
19fdee9d
编写于
2月 24, 2015
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'lmr/fix-error-stream'
上级
2734cea9
25796f71
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
6 deletion
+33
-6
avocado/__init__.py
avocado/__init__.py
+16
-1
avocado/core/output.py
avocado/core/output.py
+12
-0
selftests/all/functional/avocado/basic_tests.py
selftests/all/functional/avocado/basic_tests.py
+3
-3
selftests/all/functional/avocado/loader_tests.py
selftests/all/functional/avocado/loader_tests.py
+2
-2
未找到文件。
avocado/__init__.py
浏览文件 @
19fdee9d
...
...
@@ -21,6 +21,14 @@ DEFAULT_LOGGING = {
'format'
:
'%(message)s'
,
},
},
'filters'
:
{
'error'
:
{
'()'
:
'avocado.core.output.FilterError'
,
},
'info'
:
{
'()'
:
'avocado.core.output.FilterInfo'
,
},
},
'handlers'
:
{
'null'
:
{
'level'
:
'INFO'
,
...
...
@@ -35,8 +43,15 @@ DEFAULT_LOGGING = {
'level'
:
'INFO'
,
'class'
:
'avocado.core.output.ProgressStreamHandler'
,
'formatter'
:
'brief'
,
'filters'
:
[
'info'
],
'stream'
:
'ext://sys.stdout'
,
},
'error'
:
{
'level'
:
'ERROR'
,
'class'
:
'logging.StreamHandler'
,
'formatter'
:
'brief'
,
'filters'
:
[
'error'
],
},
'debug'
:
{
'level'
:
'DEBUG'
,
'class'
:
'avocado.core.output.ProgressStreamHandler'
,
...
...
@@ -49,7 +64,7 @@ DEFAULT_LOGGING = {
'handlers'
:
[
'console'
],
},
'avocado.app'
:
{
'handlers'
:
[
'app'
],
'handlers'
:
[
'app'
,
'error'
],
'level'
:
'INFO'
,
'propagate'
:
False
,
},
...
...
avocado/core/output.py
浏览文件 @
19fdee9d
...
...
@@ -23,6 +23,18 @@ from avocado.utils import path as utils_path
from
avocado.settings
import
settings
class
FilterError
(
logging
.
Filter
):
def
filter
(
self
,
record
):
return
record
.
levelno
>=
logging
.
ERROR
class
FilterInfo
(
logging
.
Filter
):
def
filter
(
self
,
record
):
return
record
.
levelno
==
logging
.
INFO
class
ProgressStreamHandler
(
logging
.
StreamHandler
):
"""
...
...
selftests/all/functional/avocado/basic_tests.py
浏览文件 @
19fdee9d
...
...
@@ -169,19 +169,19 @@ class RunnerOperationTest(unittest.TestCase):
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
2
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
)
self
.
assertIn
(
'File not found'
,
result
.
std
out
)
self
.
assertIn
(
'File not found'
,
result
.
std
err
)
def
test_invalid_unique_id
(
self
):
cmd_line
=
'./scripts/avocado run --sysinfo=off --force-job-id foobar skiptest'
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
self
.
assertNotEqual
(
0
,
result
.
exit_status
)
self
.
assertIn
(
'needs to be a 40 digit hex'
,
result
.
std
out
)
self
.
assertIn
(
'needs to be a 40 digit hex'
,
result
.
std
err
)
def
test_valid_unique_id
(
self
):
cmd_line
=
'./scripts/avocado run --sysinfo=off --force-job-id 975de258ac05ce5e490648dec4753657b7ccc7d1 skiptest'
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
self
.
assertEqual
(
0
,
result
.
exit_status
)
self
.
assertNotIn
(
'needs to be a 40 digit hex'
,
result
.
std
out
)
self
.
assertNotIn
(
'needs to be a 40 digit hex'
,
result
.
std
err
)
self
.
assertIn
(
'SKIP'
,
result
.
stdout
)
def
test_automatic_unique_id
(
self
):
...
...
selftests/all/functional/avocado/loader_tests.py
浏览文件 @
19fdee9d
...
...
@@ -77,7 +77,7 @@ class LoaderTestFunctional(unittest.TestCase):
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
,
"Avocado did not return rc %d:
\n
%s"
%
(
expected_rc
,
result
))
self
.
assertIn
(
'is not an avocado test'
,
result
.
std
out
)
self
.
assertIn
(
'is not an avocado test'
,
result
.
std
err
)
simple_test
.
remove
()
def
test_pass
(
self
):
...
...
@@ -141,7 +141,7 @@ class LoaderTestFunctional(unittest.TestCase):
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
,
"Avocado did not return rc %d:
\n
%s"
%
(
expected_rc
,
result
))
self
.
assertIn
(
'is not an avocado test'
,
result
.
std
out
)
self
.
assertIn
(
'is not an avocado test'
,
result
.
std
err
)
avocado_not_a_test
.
remove
()
if
__name__
==
'__main__'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录