Extend _pytest.python._idval to return __name__ of functions as well, not just for classes
This commit is contained in:
parent
88ed1ab648
commit
912330a7e2
|
@ -933,7 +933,7 @@ def _idval(val, argname, idx, idfn, config=None):
|
|||
return ascii_escaped(val.pattern)
|
||||
elif enum is not None and isinstance(val, enum.Enum):
|
||||
return str(val)
|
||||
elif isclass(val) and hasattr(val, '__name__'):
|
||||
elif (isclass(val) or isfunction(val)) and hasattr(val, '__name__'):
|
||||
return val.__name__
|
||||
return str(argname) + str(idx)
|
||||
|
||||
|
|
Loading…
Reference in New Issue