def test_deprecated_static_and_classmethod():
 class A(object, ):
  u'Docstring'
  @deprecated(u'1.0')
  @staticmethod
  def B():
   pass
  @deprecated(u'1.0')
  @classmethod
  def C(cls):
   pass
 with catch_warnings(AstropyDeprecationWarning) as w:
  A.B()
 assert (len(w) == 1)
 if (A.__doc__ is not None):
  assert (u'deprecated' in A.B.__doc__)
 with catch_warnings(AstropyDeprecationWarning) as w:
  A.C()
 assert (len(w) == 1)
 if (A.__doc__ is not None):
  assert (u'deprecated' in A.C.__doc__)

def test_deprecated_static_and_classmethod ( ) : class A ( object , ) : @ deprecated ( u'1.0' ) @ staticmethod def B ( ) : pass @ deprecated ( u'1.0' ) @ classmethod def C ( cls ) : pass with catch_warnings ( AstropyDeprecationWarning ) as w : A . B ( ) assert ( len ( w ) == 1 ) if ( A . __doc__ is not None ) : assert ( u'deprecated' in A . B . __doc__ ) with catch_warnings ( AstropyDeprecationWarning ) as w : A . C ( ) assert ( len ( w ) == 1 ) if ( A . __doc__ is not None ) : assert ( u'deprecated' in A . C . __doc__ )
regression test for issue introduced by URL and mentioned also here: URL#issuecomment-51049969 where it appears that deprecated staticmethods didnt work on python 2 .