[U-Boot] [PATCH 03/10] test/py: Fix pytest4 deprecation warnings

Simon Glass
2019-10-21T15:25:56Z

Hi Tom,

On Fri, 18 Oct 2019 at 14:53, Tom Rini <trini@konsulko.com> wrote:
>
> From: Marek Vasut <marek.vasut@gmail.com>
>
> 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>
> [trini: Update for current file with a few more cases, un-pin pytest in CI]
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> .gitlab-ci.yml | 2 +-
> .travis.yml | 2 +-
> test/py/conftest.py | 30 ++++++++++++------------------
> 3 files changed, 14 insertions(+), 20 deletions(-)

This causes a breakage on my machine even with the rest of the patches applied.

make qcheck
./test/run quick
sandbox: +make O=/scratch/sglass/cosarm/src/third_party/u-boot/files/build-sandbox
-s sandbox_defconfig
+make O=/scratch/sglass/cosarm/src/third_party/u-boot/files/build-sandbox -s -j8
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/_pytest/main.py", line 101, in
wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/_pytest/config.py", line 921, in
_do_configure
INTERNALERROR>
self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 628, in
call_historic
INTERNALERROR> res = self._hookexec(self, self._nonwrappers +
self._wrappers, kwargs)
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 222, in
_hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 216, in
<lambda>
INTERNALERROR> firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 201, in
_multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 77, in
get_result
INTERNALERROR> _reraise(*ex) # noqa
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 180, in
_multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File
"/scratch/sglass/cosarm/src/third_party/u-boot/files/test/py/conftest.py",
line 169, in pytest_configure
INTERNALERROR> ini_sio = io.StringIO(ini_str)
INTERNALERROR> TypeError: initial_value must be unicode or None, not str
sandbox_spl: +make
O=/scratch/sglass/cosarm/src/third_party/u-boot/files/build-sandbox_spl
-s sandbox_spl_defconfig
+make O=/scratch/sglass/cosarm/src/third_party/u-boot/files/build-sandbox_spl
-s -j8
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/_pytest/main.py", line 101, in
wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/_pytest/config.py", line 921, in
_do_configure
INTERNALERROR>
self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 628, in
call_historic
INTERNALERROR> res = self._hookexec(self, self._nonwrappers +
self._wrappers, kwargs)
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 222, in
_hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 216, in
<lambda>
INTERNALERROR> firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 201, in
_multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 77, in
get_result
INTERNALERROR> _reraise(*ex) # noqa
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 180, in
_multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File
"/scratch/sglass/cosarm/src/third_party/u-boot/files/test/py/conftest.py",
line 169, in pytest_configure
INTERNALERROR> ini_sio = io.StringIO(ini_str)
INTERNALERROR> TypeError: initial_value must be unicode or None, not str
sandbox_flattree: +make
O=/scratch/sglass/cosarm/src/third_party/u-boot/files/build-sandbox_flattree
-s sandbox_flattree_defconfig
+make O=/scratch/sglass/cosarm/src/third_party/u-boot/files/build-sandbox_flattree
-s -j8
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/_pytest/main.py", line 101, in
wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/_pytest/config.py", line 921, in
_do_configure
INTERNALERROR>
self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 628, in
call_historic
INTERNALERROR> res = self._hookexec(self, self._nonwrappers +
self._wrappers, kwargs)
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 222, in
_hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 216, in
<lambda>
INTERNALERROR> firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 201, in
_multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 77, in
get_result
INTERNALERROR> _reraise(*ex) # noqa
INTERNALERROR> File
"/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 180, in
_multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File
"/scratch/sglass/cosarm/src/third_party/u-boot/files/test/py/conftest.py",
line 169, in pytest_configure
INTERNALERROR> ini_sio = io.StringIO(ini_str)
INTERNALERROR> TypeError: initial_value must be unicode or None, not str

Regards,
Simon