-
-
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
Parametrizing a test with an empty list calls ids
callback with the private constant NOTSET
#13031
Comments
For empty id lists we generate a single test with a warning |
Yes, which is reasonable - but I can't detect this in my ID mapping function because it's a hidden type. Perhaps the sentinel can just be exported? Or don't call the ID map for the "no parametrization" case. I can make a PR in either case! |
I don't quite understand - I don't get access to the ParameterSet, and thus can't see its marks. I simply get |
indeed - we should use a string that indicates it |
i have a wip pr that sets the string NOTSET as direct id to avoid this - 'll polish it a litlle and push |
…ter list stand-in this ensures we dont invoke idfunc with the internal NOTSET enum token
…ter list stand-in this ensures we dont invoke idfunc with the internal NOTSET enum token
I parametrize tests based on a user-provided list. Sometimes this list is empty, which disables some tests as a result. However, I would expect the
ids
callback that I provide to not be called at all in that case, but it is actually called with the privateNOTSET
sentinel. As this is not exported, I can't easily check for it in myids
function and return a useless value to match it.Reproduction:
conftest.py
test_demo.py
Python: 3.10.15
pytest: 8.3.4
OS: macOS Sonoma 14.6.1
The text was updated successfully, but these errors were encountered: