From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 26 Jan 2016 16:18:42 -0700 Subject: [U-Boot] [PATCH] test/py: Provide custom IDs when parametrizing tests In-Reply-To: References: <1453847164-14045-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <56A7FED2.7050901@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 01/26/2016 04:08 PM, Simon Glass wrote: > Hi Stephen, > > On 26 January 2016 at 15:26, Stephen Warren wrote: >> From: Stephen Warren >> >> When pytest generates the name for parametrized tests, simple parameter >> values (ints, strings) get used directly, but more complex values such >> as dicts are not handled. This yields test names such as: >> >> dfu[env__usb_dev_port0-env__dfu_config0] >> dfu[env__usb_dev_port0-env__dfu_config1] >> >> Add some code to extract a custom fixture ID from the fixture values, so >> that we end up with meaningful names such as: >> >> dfu[micro_b-emmc] >> dfu[devport2-ram] >> >> If the boardenv file doesn't define custom names, the code falls back to >> the old algorithm. >> >> Signed-off-by: Stephen Warren >> --- >> test/py/conftest.py | 8 +++++++- >> test/py/tests/test_dfu.py | 3 +++ >> test/py/tests/test_ums.py | 3 +++ >> 3 files changed, 13 insertions(+), 1 deletion(-) > > Reviewed-by: Simon Glass > >> diff --git a/test/py/conftest.py b/test/py/conftest.py >> @@ -225,7 +225,13 @@ def pytest_generate_tests(metafunc): >> # ... otherwise, see if there's a key that contains a list of >> # values to use instead. > > Is this function comment still accurate? Yes; that comment is referring to the list of values that the relevant test function iterates over, not the names/IDs of the values or anything like that.