From patchwork Thu Jan 28 11:46:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1432749 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=g7XqqV9o; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRJb9574dz9s24 for ; Thu, 28 Jan 2021 22:46:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40F3F82737; Thu, 28 Jan 2021 12:46:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="g7XqqV9o"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D6C1A8274D; Thu, 28 Jan 2021 12:46:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DB5AC82730 for ; Thu, 28 Jan 2021 12:46:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1611834377; bh=1Iqxs7uZCM2QDXtPHpQVGsm5/n6RZ0+BHUMkDX69A6A=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=g7XqqV9oIQ+2XqYyE9WmGHrOABvX/JAdqliQsqBMNwnyq3jyIpiXnxGvkfQLKXBoQ p7VC2VoALJVnBijyj5bVco3CjUfNb4jrFK9axcp/UdZNnNLguptsjGptdjnBpad6Or y4NcVoj3KFYK6lMvIHNOPStPjpddz3jW2IyBznq0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from workstation4.fritz.box ([62.143.246.89]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MwQTF-1lxByX3tfJ-00sQMB; Thu, 28 Jan 2021 12:46:17 +0100 From: Heinrich Schuchardt To: Tom Rini Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH] test: correct entry point to pytest Date: Thu, 28 Jan 2021 12:46:11 +0100 Message-Id: <20210128114611.128865-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:3xLwj1oefDhuUH39oeUFYAMW6N37+OTEA+s704+io5L28gFKsNt Mkk2ze/E4VEJjaE0au5WPUw5Dr385IPn/fYOF7k0pV+svkg2KZtjKBDddQ6aS8hivdPAmct Axh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-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean With Pytest 6.0.2 'make tests' fails: sandbox: Traceback (most recent call last): File "./test/py/test.py", line 20, in 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 Tested-by: Andy Shevchenko Tested-by: Tom Rini --- test/py/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.29.2 diff --git a/test/py/test.py b/test/py/test.py index bee88d96bc..285fda5425 100755 --- a/test/py/test.py +++ b/test/py/test.py @@ -10,11 +10,11 @@ import os import os.path import sys +import pytest from pkg_resources import load_entry_point -# argv; py.test test_directory_name user-supplied-arguments -args = [os.path.dirname(__file__) + '/tests'] -args.extend(sys.argv) - if __name__ == '__main__': - sys.exit(load_entry_point('pytest', 'console_scripts', 'pytest')(args)) + # argv; py.test test_directory_name user-supplied-arguments + args = [os.path.dirname(__file__) + '/tests'] + args.extend(sys.argv) + sys.exit(pytest.main(args))