Closed betapl3b closed 7 months ago
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 https://github.com/TvoroG/pytest-lazy-fixture/issues/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. Let's wait until allure-framework/allure-python#793 gets merged (a day or two, I believe).
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