Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
924ad27a
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,发现更多精彩内容 >>
未验证
提交
924ad27a
编写于
8月 31, 2018
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'enable-pylint-w0613'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
b7eb1762
6590d5de
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
36 addition
and
21 deletion
+36
-21
avocado/core/decorators.py
avocado/core/decorators.py
+1
-1
avocado/core/loader.py
avocado/core/loader.py
+2
-2
avocado/core/varianter.py
avocado/core/varianter.py
+1
-1
avocado/plugins/journal.py
avocado/plugins/journal.py
+1
-1
avocado/utils/external/gdbmi_parser.py
avocado/utils/external/gdbmi_parser.py
+1
-1
avocado/utils/external/spark.py
avocado/utils/external/spark.py
+3
-3
avocado/utils/gdb.py
avocado/utils/gdb.py
+1
-1
avocado/utils/process.py
avocado/utils/process.py
+6
-7
examples/plugins/job-pre-post/sleep/avocado_job_sleep.py
examples/plugins/job-pre-post/sleep/avocado_job_sleep.py
+1
-1
selftests/checkall
selftests/checkall
+1
-1
selftests/functional/test_basic.py
selftests/functional/test_basic.py
+1
-1
selftests/unit/test_utils_iso9660.py
selftests/unit/test_utils_iso9660.py
+5
-0
selftests/unit/test_utils_memory.py
selftests/unit/test_utils_memory.py
+11
-0
selftests/unit/test_utils_process.py
selftests/unit/test_utils_process.py
+1
-1
未找到文件。
avocado/core/decorators.py
浏览文件 @
924ad27a
...
...
@@ -62,7 +62,7 @@ def skip(message=None):
def
decorator
(
function
):
if
not
isinstance
(
function
,
type
):
@
wraps
(
function
)
def
wrapper
(
*
args
,
**
kwargs
):
def
wrapper
(
*
args
,
**
kwargs
):
# pylint: disable=W0613
raise
core_exceptions
.
TestSkipError
(
message
)
function
=
wrapper
function
.
__skip_test_decorator__
=
True
...
...
avocado/core/loader.py
浏览文件 @
924ad27a
...
...
@@ -609,7 +609,7 @@ class FileLoader(TestLoader):
tests
.
extend
(
self
.
_make_tests
(
exception
.
filename
,
which_tests
==
DiscoverMode
.
ALL
))
def
skip_non_test
(
exception
):
def
skip_non_test
(
exception
):
# pylint: disable=W0613
""" Always return None """
return
None
...
...
@@ -743,7 +743,7 @@ class FileLoader(TestLoader):
:param list_non_tests: include bad tests (NotATest, BrokenSymlink,...)
:param subtests_filter: optional filter of methods for avocado tests
"""
def
ignore_broken
(
klass
,
uid
,
description
=
None
):
def
ignore_broken
(
klass
,
uid
,
description
=
None
):
# pylint: disable=W0613
""" Always return empty list """
return
[]
...
...
avocado/core/varianter.py
浏览文件 @
924ad27a
...
...
@@ -137,7 +137,7 @@ class FakeVariantDispatcher(object):
else
:
return
[]
def
to_str
(
self
,
summary
=
0
,
variants
=
0
,
**
kwargs
):
def
to_str
(
self
,
summary
=
0
,
variants
=
0
,
**
kwargs
):
# pylint: disable=W0613
if
not
self
.
variants
:
return
""
out
=
[]
...
...
avocado/plugins/journal.py
浏览文件 @
924ad27a
...
...
@@ -44,7 +44,7 @@ class JournalResult(ResultEvents):
name
=
'journal'
description
=
"Journal event based results implementation"
def
__init__
(
self
,
args
):
def
__init__
(
self
,
args
):
# pylint: disable=W0613
"""
Creates an instance of ResultJournal.
...
...
avocado/utils/external/gdbmi_parser.py
浏览文件 @
924ad27a
...
...
@@ -72,7 +72,7 @@ def __private():
spark
.
GenericScanner
.
tokenize
(
self
,
input_message
)
return
self
.
rv
def
t_nl
(
self
,
s
):
def
t_nl
(
self
,
s
):
# pylint: disable=W0613
r
'\n|\r\n'
self
.
rv
.
append
(
Token
(
'nl'
))
...
...
avocado/utils/external/spark.py
浏览文件 @
924ad27a
...
...
@@ -62,7 +62,7 @@ class GenericScanner:
rv
.
append
(
self
.
makeRE
(
't_default'
))
return
'|'
.
join
(
rv
)
def
error
(
self
,
s
,
pos
):
def
error
(
self
,
s
,
pos
):
# pylint: disable=W0613
print
(
"Lexical error at position %s"
%
pos
)
raise
SystemExit
...
...
@@ -88,7 +88,7 @@ class GenericScanner:
self
.
index2func
.
has_key
(
i
):
self
.
index2func
[
i
](
groups
[
i
])
def
t_default
(
self
,
s
):
def
t_default
(
self
,
s
):
# pylint: disable=W0613
r
'( . | \n )+'
print
(
"Specification error: unmatched input"
)
raise
SystemExit
...
...
@@ -307,7 +307,7 @@ class GenericParser:
self
.
newrules
[
lhs
]
=
[
rule
]
self
.
new2old
[
rule
]
=
oldrule
def
typestring
(
self
,
token
):
def
typestring
(
self
,
token
):
# pylint: disable=W0613
return
None
def
error
(
self
,
token
):
...
...
avocado/utils/gdb.py
浏览文件 @
924ad27a
...
...
@@ -622,7 +622,7 @@ class GDBServer(object):
#: ready to accept new connections
INIT_TIMEOUT
=
5.0
def
__init__
(
self
,
path
=
'/usr/bin/gdbserver'
,
port
=
None
,
def
__init__
(
self
,
path
=
'/usr/bin/gdbserver'
,
port
=
None
,
# pylint: disable=W0613
wait_until_running
=
True
,
*
extra_args
):
"""
Initializes a new gdbserver instance
...
...
avocado/utils/process.py
浏览文件 @
924ad27a
...
...
@@ -628,7 +628,7 @@ class SubProcess(object):
self
.
_stdout_drainer
.
start
()
self
.
_stderr_drainer
.
start
()
def
signal_handler
(
signum
,
frame
):
def
signal_handler
(
signum
,
frame
):
# pylint: disable=W0613
self
.
result
.
interrupted
=
"signal/ctrl+c"
self
.
wait
()
signal
.
default_int_handler
()
...
...
@@ -841,9 +841,8 @@ class GDBSubProcess(object):
Runs a subprocess inside the GNU Debugger
"""
def
__init__
(
self
,
cmd
,
verbose
=
True
,
allow_output_check
=
None
,
shell
=
False
,
env
=
None
,
sudo
=
False
,
ignore_bg_processes
=
False
,
encoding
=
None
):
def
__init__
(
self
,
cmd
,
verbose
=
True
,
allow_output_check
=
None
,
shell
=
False
,
# pylint: disable=W0613
env
=
None
,
sudo
=
False
,
ignore_bg_processes
=
False
,
encoding
=
None
):
# pylint: disable=W0613
"""
Creates the subprocess object, stdout/err, reader threads and locks.
...
...
@@ -945,7 +944,7 @@ class GDBSubProcess(object):
shutil
.
copy
(
self
.
binary
,
runtime
.
CURRENT_TEST
.
outputdir
)
return
core_path
def
handle_break_hit
(
self
,
response
):
def
handle_break_hit
(
self
,
response
):
# pylint: disable=W0613
self
.
gdb
.
disconnect
()
script_path
,
fifo_path
=
self
.
generate_gdb_connect_sh
()
...
...
@@ -964,7 +963,7 @@ class GDBSubProcess(object):
runtime
.
CURRENT_TEST
.
paused
=
''
return
ret
def
handle_fatal_signal
(
self
,
response
):
def
handle_fatal_signal
(
self
,
response
):
# pylint: disable=W0613
script_path
,
fifo_path
=
self
.
generate_gdb_connect_sh
()
msg
=
(
"
\n\n
TEST PAUSED because inferior process received a FATAL SIGNAL. "
...
...
@@ -1084,7 +1083,7 @@ class GDBSubProcess(object):
for
command
in
genio
.
read_all_lines
(
prerun_commands_path
):
self
.
gdb
.
cmd
(
command
)
def
run
(
self
,
timeout
=
None
):
def
run
(
self
,
timeout
=
None
):
# pylint: disable=W0613
for
b
in
self
.
_get_breakpoints
():
self
.
gdb
.
set_break
(
b
,
ignore_error
=
True
)
...
...
examples/plugins/job-pre-post/sleep/avocado_job_sleep.py
浏览文件 @
924ad27a
...
...
@@ -18,7 +18,7 @@ class Sleep(JobPre, JobPost):
key_type
=
int
,
default
=
3
)
def
sleep
(
self
,
job
):
def
sleep
(
self
,
job
):
# pylint: disable=W0613
for
i
in
range
(
1
,
self
.
seconds
+
1
):
LOG_UI
.
info
(
"Sleeping %2i/%s"
,
i
,
self
.
seconds
)
time
.
sleep
(
1
)
...
...
selftests/checkall
浏览文件 @
924ad27a
...
...
@@ -169,7 +169,7 @@ results_dir_content() {
[
"
$SKIP_RESULTSDIR_CHECK
"
]
||
RESULTS_DIR_CONTENT
=
"
$(
ls
$RESULTS_DIR
2> /dev/null
)
"
LINT_CMD
=
"inspekt lint --exclude=.git"
PYLINT_ENABLE
=
"--enable R0401,W0101,W0102,W0104,W0105,W0106,W0107,W0108,W0109,W0111,W0120,W0122,W0123,W0124,W0125,W0150,W0199,W0211,W0222,W0232,W0233,W0301,W0312,W0401,W0404,W0406,W0410,W0601,W0602,W0603,W0604,W0611,W0612,W0614,W0622,W0623,W0640,W0711,W1201,W1202,W1300,W1301,W1302,W1303,W1304,W1305,W1306,W1307,W1401,W1402,W1501,W1503,W1645"
PYLINT_ENABLE
=
"--enable R0401,W0101,W0102,W0104,W0105,W0106,W0107,W0108,W0109,W0111,W0120,W0122,W0123,W0124,W0125,W0150,W0199,W0211,W0222,W0232,W0233,W0301,W0312,W0401,W0404,W0406,W0410,W0601,W0602,W0603,W0604,W0611,W0612,W061
3,W061
4,W0622,W0623,W0640,W0711,W1201,W1202,W1300,W1301,W1302,W1303,W1304,W1305,W1306,W1307,W1401,W1402,W1501,W1503,W1645"
if
[
"
$AVOCADO_PARALLEL_LINT
"
]
;
then
LINT_CMD
=
"
$LINT_CMD
--parallel=
$AVOCADO_PARALLEL_LINT
"
fi
...
...
selftests/functional/test_basic.py
浏览文件 @
924ad27a
...
...
@@ -1197,7 +1197,7 @@ class PluginsXunitTest(AbsPluginsTest, unittest.TestCase):
super
(
PluginsXunitTest
,
self
).
setUp
()
def
run_and_check
(
self
,
testname
,
e_rc
,
e_ntests
,
e_nerrors
,
e_nnotfound
,
e_nfailures
,
e_nskip
):
e_nnotfound
,
e_nfailures
,
e_nskip
):
# pylint: disable=W0613
cmd_line
=
(
'%s run --job-results-dir %s --sysinfo=off'
' --xunit - %s'
%
(
AVOCADO
,
self
.
tmpdir
,
testname
))
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
...
...
selftests/unit/test_utils_iso9660.py
浏览文件 @
924ad27a
...
...
@@ -26,6 +26,7 @@ class Capabilities(unittest.TestCase):
def
test_capabilities_pycdlib
(
self
,
has_pycdlib_mocked
):
instance
=
iso9660
.
iso9660
(
self
.
iso_path
,
[
'read'
,
'create'
,
'write'
])
self
.
assertIsInstance
(
instance
,
iso9660
.
ISO9660PyCDLib
)
self
.
assertTrue
(
has_pycdlib_mocked
.
called
)
@
mock
.
patch
(
'avocado.utils.iso9660.has_pycdlib'
,
return_value
=
False
)
@
mock
.
patch
(
'avocado.utils.iso9660.has_isoinfo'
,
return_value
=
False
)
...
...
@@ -34,6 +35,10 @@ class Capabilities(unittest.TestCase):
def
test_capabilities_nobackend
(
self
,
has_pycdlib_mocked
,
has_isoinfo_mocked
,
has_isoread_mocked
,
can_mount_mocked
):
self
.
assertIsNone
(
iso9660
.
iso9660
(
self
.
iso_path
,
[
'read'
]))
self
.
assertTrue
(
has_pycdlib_mocked
.
called
)
self
.
assertTrue
(
has_isoinfo_mocked
.
called
)
self
.
assertTrue
(
has_isoread_mocked
.
called
)
self
.
assertTrue
(
can_mount_mocked
.
called
)
def
test_non_existing_capabilities
(
self
):
self
.
assertIsNone
(
iso9660
.
iso9660
(
self
.
iso_path
,
...
...
selftests/unit/test_utils_memory.py
浏览文件 @
924ad27a
...
...
@@ -34,12 +34,14 @@ class UtilsMemoryTestGetBuddyInfo(unittest.TestCase):
chunk_size
=
'0'
result
=
memory
.
get_buddy_info
(
chunk_size
)
self
.
assertEqual
(
result
[
chunk_size
],
6418
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_less_than_chunk_size
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'<2'
result
=
memory
.
get_buddy_info
(
chunk_size
)
self
.
assertEqual
(
result
[
'0'
],
6418
)
self
.
assertEqual
(
result
[
'1'
],
10439
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_less_than_equal_chunk_size
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'<=2'
...
...
@@ -47,12 +49,14 @@ class UtilsMemoryTestGetBuddyInfo(unittest.TestCase):
self
.
assertEqual
(
result
[
'0'
],
6418
)
self
.
assertEqual
(
result
[
'1'
],
10439
)
self
.
assertEqual
(
result
[
'2'
],
10048
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_greater_than_chunk_size
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'>3'
result
=
memory
.
get_buddy_info
(
chunk_size
)
self
.
assertEqual
(
result
[
'4'
],
19278
)
self
.
assertEqual
(
result
[
'5'
],
10357
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_greater_than_equal_chunk_size
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'>=3'
...
...
@@ -60,17 +64,20 @@ class UtilsMemoryTestGetBuddyInfo(unittest.TestCase):
self
.
assertEqual
(
result
[
'3'
],
12819
)
self
.
assertEqual
(
result
[
'4'
],
19278
)
self
.
assertEqual
(
result
[
'5'
],
10357
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_multiple_chunk_size
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'2 4'
result
=
memory
.
get_buddy_info
(
chunk_size
)
self
.
assertEqual
(
result
[
'2'
],
10048
)
self
.
assertEqual
(
result
[
'4'
],
19278
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_multiple_chunk_size_filtering_simple
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'>2 <4'
result
=
memory
.
get_buddy_info
(
chunk_size
)
self
.
assertEqual
(
result
[
'3'
],
12819
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_multiple_chunk_size_filtering
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'>=2 <=4'
...
...
@@ -78,21 +85,25 @@ class UtilsMemoryTestGetBuddyInfo(unittest.TestCase):
self
.
assertEqual
(
result
[
'2'
],
10048
)
self
.
assertEqual
(
result
[
'3'
],
12819
)
self
.
assertEqual
(
result
[
'4'
],
19278
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_multiple_chunk_size_filtering_invalid
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'>2 <2'
result
=
memory
.
get_buddy_info
(
chunk_size
)
self
.
assertEqual
(
result
,
{})
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_filtering_node
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'0'
result
=
memory
.
get_buddy_info
(
chunk_size
,
nodes
=
'1'
)
self
.
assertEqual
(
result
[
chunk_size
],
5430
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
def
test_get_buddy_info_filtering_zone
(
self
,
buddy_info_content_mocked
):
chunk_size
=
'0'
result
=
memory
.
get_buddy_info
(
chunk_size
,
zones
=
'DMA32'
)
self
.
assertEqual
(
result
[
chunk_size
],
987
)
self
.
assertTrue
(
buddy_info_content_mocked
.
called
)
if
__name__
==
'__main__'
:
...
...
selftests/unit/test_utils_process.py
浏览文件 @
924ad27a
...
...
@@ -94,7 +94,7 @@ class TestGDBProcess(unittest.TestCase):
self
.
assertIsInstance
(
process
.
split_gdb_expr
(
'foo:debug_print'
),
tuple
)
def
mock_fail_find_cmd
(
cmd
,
default
=
None
):
def
mock_fail_find_cmd
(
cmd
,
default
=
None
):
# pylint: disable=W0613
path_paths
=
[
"/usr/libexec"
,
"/usr/local/sbin"
,
"/usr/local/bin"
,
"/usr/sbin"
,
"/usr/bin"
,
"/sbin"
,
"/bin"
]
raise
path
.
CmdNotFoundError
(
cmd
,
path_paths
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录