Extend _pytest.python._idval to return __name__ of functions as well #2976
I want to parametrize over factory functions, which I believe is a valid use-case. At the moment, the autogenerated id for the test name is then based on the argument name, plus counter to disambiguate (e.g. feature_factory0, feature_factory1, etc.). With this PR, the default behavior for functions will be the same as for classes: return the
As Kernel1, Kernel2, Kernel3 are classes, currently, the tests would be named as follows:
With this PR, the test names would be:
This allows you to immediately figure out which factory function is being used, and doesn't hide the fact that "feature_factory0" and "feature_factory1" are the same thing.
I hope you'll be happy to merge this :-)
PS: Pytest is great, thanks!!