def test_wraps_keep_orig_name():
 def foo():
  pass
 assigned = list(functools.WRAPPER_ASSIGNMENTS)
 assigned.remove(u'__name__')
 def bar():
  pass
 orig_bar = bar
 bar = wraps(foo, assigned=assigned)(bar)
 assert (bar is not orig_bar)
 assert (bar.__name__ == u'bar')

def test_wraps_keep_orig_name ( ) : def foo ( ) : pass assigned = list ( functools . WRAPPER_ASSIGNMENTS ) assigned . remove ( u'__name__' ) def bar ( ) : pass orig_bar = bar bar = wraps ( foo , assigned = assigned ) ( bar ) assert ( bar is not orig_bar ) assert ( bar . __name__ == u'bar' )
test that when __name__ is excluded from the assigned argument to wrap that the function being wrapped keeps its original name .