mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
test/py: Fix pytest4 deprecation warnings
Fix the following spit from pytest: u-boot/test/py/conftest.py:438: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly. Please use node.get_closest_marker(name) or node.iter_markers(name). Docs: https://docs.pytest.org/en/latest/mark.html#updating-code for board in mark.args: In both cases, the later suggestion is applicable. Reviewed-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Igor Opaniuk <igor.opaniuk@gmail.com> [trini: Update for current file with a few more cases, un-pin pytest in CI] Tested-by: Simon Glass <sjg@chromium.org> [on sandbox] Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
79883ef7dc
commit
3c941e048c
3 changed files with 14 additions and 20 deletions
|
@ -20,7 +20,7 @@ stages:
|
||||||
- ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
|
- ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
|
||||||
- virtualenv /tmp/venv
|
- virtualenv /tmp/venv
|
||||||
- . /tmp/venv/bin/activate
|
- . /tmp/venv/bin/activate
|
||||||
- pip install pytest==2.8.7
|
- pip install pytest
|
||||||
- pip install python-subunit
|
- pip install python-subunit
|
||||||
- pip install coverage
|
- pip install coverage
|
||||||
- grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
- grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
||||||
|
|
|
@ -49,7 +49,7 @@ install:
|
||||||
- cat ~/.buildman
|
- cat ~/.buildman
|
||||||
- virtualenv /tmp/venv
|
- virtualenv /tmp/venv
|
||||||
- . /tmp/venv/bin/activate
|
- . /tmp/venv/bin/activate
|
||||||
- pip install pytest==2.8.7
|
- pip install pytest
|
||||||
- pip install python-subunit
|
- pip install python-subunit
|
||||||
- pip install pyelftools
|
- pip install pyelftools
|
||||||
- grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
- grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
||||||
|
|
|
@ -431,11 +431,9 @@ def setup_boardspec(item):
|
||||||
Nothing.
|
Nothing.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
mark = item.get_marker('boardspec')
|
|
||||||
if not mark:
|
|
||||||
return
|
|
||||||
required_boards = []
|
required_boards = []
|
||||||
for board in mark.args:
|
for boards in item.iter_markers('boardspec'):
|
||||||
|
board = boards.args[0]
|
||||||
if board.startswith('!'):
|
if board.startswith('!'):
|
||||||
if ubconfig.board_type == board[1:]:
|
if ubconfig.board_type == board[1:]:
|
||||||
pytest.skip('board "%s" not supported' % ubconfig.board_type)
|
pytest.skip('board "%s" not supported' % ubconfig.board_type)
|
||||||
|
@ -459,14 +457,12 @@ def setup_buildconfigspec(item):
|
||||||
Nothing.
|
Nothing.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
mark = item.get_marker('buildconfigspec')
|
for options in item.iter_markers('buildconfigspec'):
|
||||||
if mark:
|
option = options.args[0]
|
||||||
for option in mark.args:
|
|
||||||
if not ubconfig.buildconfig.get('config_' + option.lower(), None):
|
if not ubconfig.buildconfig.get('config_' + option.lower(), None):
|
||||||
pytest.skip('.config feature "%s" not enabled' % option.lower())
|
pytest.skip('.config feature "%s" not enabled' % option.lower())
|
||||||
notmark = item.get_marker('notbuildconfigspec')
|
for option in item.iter_markers('notbuildconfigspec'):
|
||||||
if notmark:
|
option = options.args[0]
|
||||||
for option in notmark.args:
|
|
||||||
if ubconfig.buildconfig.get('config_' + option.lower(), None):
|
if ubconfig.buildconfig.get('config_' + option.lower(), None):
|
||||||
pytest.skip('.config feature "%s" enabled' % option.lower())
|
pytest.skip('.config feature "%s" enabled' % option.lower())
|
||||||
|
|
||||||
|
@ -491,10 +487,8 @@ def setup_requiredtool(item):
|
||||||
Nothing.
|
Nothing.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
mark = item.get_marker('requiredtool')
|
for tools in item.iter_markers('requiredtool'):
|
||||||
if not mark:
|
tool = tools.args[0]
|
||||||
return
|
|
||||||
for tool in mark.args:
|
|
||||||
if not tool_is_in_path(tool):
|
if not tool_is_in_path(tool):
|
||||||
pytest.skip('tool "%s" not in $PATH' % tool)
|
pytest.skip('tool "%s" not in $PATH' % tool)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue