-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pytest ParameterSet.id placeholder for @allure.title formatter #787
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#793 is merged.
Just one small grammar fix and we're good to go!
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.title
you need to use therequest
fixture in combination with theallure.dynamic.title
function.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.title
is executed and the test result is left without DisplayName.Checklist