All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] test/py: Provide custom IDs when parametrizing tests
Date: Tue, 26 Jan 2016 16:18:42 -0700	[thread overview]
Message-ID: <56A7FED2.7050901@wwwdotorg.org> (raw)
In-Reply-To: <CAPnjgZ1u3JyDvKyvCPygwfiQq6L87+kE4kfwtt39heEqyOL1+g@mail.gmail.com>

On 01/26/2016 04:08 PM, Simon Glass wrote:
> Hi Stephen,
>
> On 26 January 2016 at 15:26, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> 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 <swarren@nvidia.com>
>> ---
>>   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 <sjg@chromium.org>
>
>> 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.

  reply	other threads:[~2016-01-26 23:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 22:26 [U-Boot] [PATCH] test/py: Provide custom IDs when parametrizing tests Stephen Warren
2016-01-26 23:08 ` Simon Glass
2016-01-26 23:18   ` Stephen Warren [this message]
2016-01-29  4:02     ` Simon Glass

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=56A7FED2.7050901@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --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.