def test_copy_doc():
 class A:
  def m1():
   'Docstring for m1'
   pass
 class B:
  def m1():
   pass
 class C(A, ):
  @copy_doc(A.m1)
  def m1():
   pass
 assert_equal(C.m1.__doc__, 'Docstring for m1')
 assert_raises(ValueError, copy_doc(B.m1), C.m1)

def test_copy_doc ( ) : class A : def m1 ( ) : pass class B : def m1 ( ) : pass class C ( A , ) : @ copy_doc ( A . m1 ) def m1 ( ) : pass assert_equal ( C . m1 . __doc__ , 'Docstring for m1' ) assert_raises ( ValueError , copy_doc ( B . m1 ) , C . m1 )
test decorator for copying docstrings .