Add pytest ParameterSet.id placeholder for @allure.title formatter#787
Add pytest ParameterSet.id placeholder for @allure.title formatter#787delatrie merged 7 commits intoallure-framework:masterfrom
Conversation
delatrie
left a comment
There was a problem hiding this comment.
Hi, @betapl3b ! Sorry for taking it so long.
Thanks for your contribution. The feature is nice to have, and I'm okay with pre-defined variables in that context.
The only thing I would ask you to change is to make the pre-defined variable overwritable by an explicit argument of a test (an extra test for that behavior would also be nice to have). See my comment for the example.
Hello! Thank you for your feedback. It makes sense! |
|
Hi @delatrie, the changes in the pytest 8.0.0 release seem to break the tests. I tested them locally using the previous version (pytest 7.4.4) and they work fine. What do you do in these cases? Should we fix the requirements to prevent pytest 8.0.0 from being updated? P.S. seems like TvoroG/pytest-lazy-fixture#65 is the reason |
|
I don't think we should refrain from testing against the most recent version of pytest. It's unlikely the issue will be fixed soon (if at all) in lazy-fixture. |
Co-authored-by: Maxim <17935127+delatrie@users.noreply.github.com>
Co-authored-by: Maxim <17935127+delatrie@users.noreply.github.com>
…llure-framework#787) Co-authored-by: Maxim <17935127+delatrie@users.noreply.github.com>
Context
Currently, to use
ParameterSet.id(pytest.param(id=*)) inallure.titleyou need to use therequestfixture in combination with theallure.dynamic.titlefunction.Thus, the complete design looks like this:
My fix suggests using the following syntax:
Since many people already assign identifiers to their parameter sets, this syntax will save them from duplicating code. And it will also help avoid situations where a test fails before
allure.dynamic.titleis executed and the test result is left without DisplayName.Checklist