-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
yield_namespace_device_dtype_combinations
parametrization ID confusing for 'device1'
#31042
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
Comments
Actually I've just realised that the ID 'device' depends on the number of namespaces supported in the environment, but the above does seem to be the case for a few of the azure workflows. |
This also tripped me up a while back. So it is probably worth fixing. We use the "generate IDs" approach for other tests and it is really nice, so maybe we should just do that here as well. The other approach that could be nice, but not sure if it is feasible, is to modify |
I don't think this is possible. If it's not Numbers, strings, booleans and None, then pytest will use the argument name: https://docs.pytest.org/en/stable/example/parametrize.html#different-options-for-test-ids I was naively hoping a Happy to add a 'generate ID' function, if others don't think its adding too much complexity |
I don't have a better solution to propose... and the current status quo is really misleading, so probably worth fixing. |
Noticed in #29431 (comment)
In
yield_namespace_device_dtype_combinations
, forarray_api_strict
we yieldCPU_DEVICE
first, thendevice1
. This results in the confusing pytest parametrization IDs:array_api_strict-device2-float32
- where 'device2' actually refers toDevice("device1")
and notDevice("device2")
array_api_strict-device1-float64
- where 'device1' actually refers toDevice("CPU_DEVICE")
and notDevice("device1")
Not sure if there is an good fix for this / or if a fix is needed.
We could yield
Device("device1")
first but then the id "device2" would refer toDevice("CPU_DEVICE")
and notDevice("device2")
The only way to completely avoid confusion would be to write a function that takes a params and amends the names e.g.,
The BUT I am not sure if this is an over complicated solution to a trivial problem...
(Edit: We could just make a note in the
yield_namespace_device_dtype_combinations
docstring - this seems like a reasonable solution...)The text was updated successfully, but these errors were encountered: