All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] test/py: Fix pytest4 deprecation warnings
Date: Wed, 13 Mar 2019 05:08:14 +0100	[thread overview]
Message-ID: <20190313040814.17030-1-marek.vasut+renesas@gmail.com> (raw)

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 <marek.vasut+renesas@gmail.com>
Cc: Igor Opaniuk <igor.opaniuk@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
---
 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

             reply	other threads:[~2019-03-13  4:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13  4:08 Marek Vasut [this message]
2019-03-13 11:19 ` [U-Boot] [PATCH] test/py: Fix pytest4 deprecation warnings Tom Rini
2019-03-13 11:20   ` Marek Vasut
2019-03-13 11:25     ` Tom Rini
2019-03-13 11:27       ` Marek Vasut
2019-03-13 11:29         ` Tom Rini
2019-03-13 11:30           ` Marek Vasut
2019-03-13 16:01             ` Tom Rini
2019-03-13 18:23               ` Marek Vasut
2019-03-13 19:42                 ` Tom Rini
2019-03-14  0:20                   ` Marek Vasut
2019-03-14  1:01                     ` Tom Rini
2019-03-15 17:39                       ` Marek Vasut
2019-03-16  1:50                         ` Tom Rini
2019-03-16 20:23                           ` Marek Vasut
2019-03-16 20:35                             ` Tom Rini
2019-03-17 12:47                       ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190313040814.17030-1-marek.vasut+renesas@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.