[PATCH] test: correct entry point to pytest

Tom Rini trini at konsulko.com
Thu Jan 28 17:17:34 CET 2021


On Thu, Jan 28, 2021 at 02:28:03PM +0100, Heinrich Schuchardt wrote:
> On 28.01.21 13:58, Tom Rini wrote:
> > On Thu, Jan 28, 2021 at 12:46:11PM +0100, Heinrich Schuchardt wrote:
> >
> >> With Pytest 6.0.2 'make tests' fails:
> >>
> >> sandbox: Traceback (most recent call last):
> >>   File "./test/py/test.py", line 20, in <module>
> >>     sys.exit(load_entry_point('pytest', 'console_scripts', 'pytest')(args))
> >> TypeError: console_main() takes 0 positional arguments but 1 was given
> >>
> >> The definition of console_scripts has changed as follows:
> >>
> >> Pytest 4.6.1:
> >>
> >> [options.entry_points]
> >> console_scripts =
> >>         pytest=pytest:main
> >>         py.test=pytest:main
> >>         
> >> Pytest 6.0.2:
> >>         
> >> [options.entry_points]
> >> console_scripts =
> >>     pytest=pytest:console_main
> >>     py.test=pytest:console_main
> >>
> >> The new function console_main() has a comment:
> >> "This function is not meant for programmable use; use `main()`"
> >>
> >> Hence let's call pytest.main() directly.
> >> Move args processing into the __main__ paragraph.
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> >> ---
> >>  test/py/test.py | 10 +++++-----
> >>  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > So the last round of "newer pytest means we need to ..." was part of why
> > we have test/py/requirements.txt right now.  That was over a year ago.
> > So, for after v2021.04 it would be good to update pytest to current and
> > deal with any updating that needs updating in our tests and related
> > code.  Thanks!
> >
> 
> This patch is not about making new requirements. It is about increasing
> the compatibility of our Python script with a larger range of Pytest
> revisions.
> 
> So I do not see the show-stopper for the current release.

I bring up the last time because we support using "pip install -r
test/py/requirements.txt" as how to create the supported test
environment.  This is based on my understanding of the time of the best
practices of dealing with python modules.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/66359715/attachment.sig>


More information about the U-Boot mailing list