Closed souliane closed 1 year ago
You might be able to work around this with the doc_func
param in parameterized
Hey! Would you be able to provide an example of a situation where a failed test does not include the parameters it was called with? I believe they should generally be displayed, but it's entirely possible one has been missed.
I'm going to close this issue for now, but please feel free to re-open if you're still interested!
Hi,
I think doc_func
can achieve the same as param.id
in pytest, but it's not as straightforward to use because you need to define a function, and build the string according to its params.
And yes, the params are displayed when the test fails, but sometimes it's handier to identity the test with a human readable description instead of the params values. My suggestion was about adding a possibility to set that human readable string at the param(...)
level.
Anyway, I am fine with the current feature/behavior, thanks!
It would be great to add an
id
attribute toparam
. This is useful in pytest to give custom names to tests, so that if one test fails, we can easily spot it.c.f.
test_timedistance_v3
in https://docs.pytest.org/en/6.2.x/example/parametrize.html?highlight=param#different-options-for-test-ids