-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
params
on Fixture are not always detected during test generation
#11350
Comments
This is in essence a more boiled down version of #2844. Calculation of the fixture closure (and following that parametrization) are to eager. |
Hi @Zac-HD , I would like to pick this up. Will share the solution in a while. |
As far as I can see here the issue is multiple fixtures with the same name (a in this case) but different parameters. The last fixture definition with the same name takes precedence, and its arguments override the earlier fixture's arguments. |
If we want to handle this in a code then we can append a unique identifier to each fixture name based on its parameterization. This will ensure that fixtures with different parameterizations are treated as separate fixtures. |
A key problem here is that fixtures may be overridden by fixtures of the same name, and different fixture of that override chain may have different parameterization Currently Parameterization just goes by name and falls flat on both overrides We are quite far away from parameterization by fixture definition/alias |
Issue
params
on fixtures that are used by a shadowed but used other fixture are not always detected during test generation and subsequent test execution fails with an error.Example
Cause
During calculation of the fixture closue only the the arguments of the last
FixtureDef
for a fiven argument are expanded.The sequences of
FixtureDef
s are ordered alphabetical by their name (qualname?) of their function object (e.g. swapping the names ofa1
anda2
works).In the example above this result in the arguments of
a1
being ignored andb
never being picked up on, resulting in the error at execution time.The text was updated successfully, but these errors were encountered: