def test_wraps_exclude_names():
 class TestClass(object, ):
  def method(self, a, b, c=1, d=2, **kwargs):
   return (a, b, c, d, kwargs)
 test = TestClass()
 @wraps(test.method, exclude_args=(u'self',))
 def func(*args, **kwargs):
  return test.method(*args, **kwargs)
 if six.PY2:
  argspec = inspect.getargspec(func)
 else:
  argspec = inspect.getfullargspec(func)
 assert (argspec.args == [u'a', u'b', u'c', u'd'])
 assert (func(u'a', u'b', e=3) == (u'a', u'b', 1, 2, {u'e': 3}))

def test_wraps_exclude_names ( ) : class TestClass ( object , ) : def method ( self , a , b , c = 1 , d = 2 , ** kwargs ) : return ( a , b , c , d , kwargs ) test = TestClass ( ) @ wraps ( test . method , exclude_args = ( u'self' , ) ) def func ( * args , ** kwargs ) : return test . method ( * args , ** kwargs ) if six . PY2 : argspec = inspect . getargspec ( func ) else : argspec = inspect . getfullargspec ( func ) assert ( argspec . args == [ u'a' , u'b' , u'c' , u'd' ] ) assert ( func ( u'a' , u'b' , e = 3 ) == ( u'a' , u'b' , 1 , 2 , { u'e' : 3 } ) )
test the optional exclude_names argument to the wraps decorator .