Remove __wrapped__ hack
@@ -215,16 +215,11 @@ def _contains_signed_and_unsigned(kw):
def _wraps_partial(wrapped, *names):
+ # Only `wrapped` function have args of `names`.
def decorator(impl):
impl = functools.wraps(wrapped)(impl)
- # Tell pytest that names are consumed
- msg = (
- "Unused value!! True `__wrapped__` function is inside `partial`, "
- "which can be accessed by `.func`. The decorated function does "
- "not receive this argument, but the original function should do."
- )
- impl.__wrapped__ = functools.partial(
- wrapped, **{name: msg for name in names})
+ impl.__signature__ = inspect.signature(
+ functools.partial(wrapped, **{name: None for name in names}))
return impl
return decorator
