From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 13 Mar 2019 05:08:14 +0100 Subject: [U-Boot] [PATCH] test/py: Fix pytest4 deprecation warnings Message-ID: <20190313040814.17030-1-marek.vasut+renesas@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. Signed-off-by: Marek Vasut Cc: Igor Opaniuk Cc: Tom Rini Cc: Simon Glass --- test/py/conftest.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index e40cbf0ba1..745ca5ac4a 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -431,11 +431,9 @@ def setup_boardspec(item): Nothing. """ - mark = item.get_marker('boardspec') - if not mark: - return required_boards = [] - for board in mark.args: + for boards in item.iter_markers('boardspec'): + board = boards.args[0] if board.startswith('!'): if ubconfig.board_type == board[1:]: pytest.skip('board "%s" not supported' % ubconfig.board_type) @@ -459,10 +457,8 @@ def setup_buildconfigspec(item): Nothing. """ - mark = item.get_marker('buildconfigspec') - if not mark: - return - for option in mark.args: + for options in item.iter_markers('buildconfigspec'): + option = options.args[0] if not ubconfig.buildconfig.get('config_' + option.lower(), None): pytest.skip('.config feature "%s" not enabled' % option.lower()) -- 2.20.1