use __name__ attribute of objects in parameterize's _param_to_str
@@ -27,6 +27,9 @@ def _raise_from(exc_type, message, orig_exc):
def _param_to_str(obj):
if isinstance(obj, type):
return obj.__name__
+ elif hasattr(obj, '__name__') and isinstance(obj.__name__, str):
+ # print __name__ attribute for classes, functions and modules
+ return obj.__name__
return repr(obj)
