def test_signature_is_definition():
 s = 'class Spam(): pass\nSpam'
 signature = Script((s + '(')).call_signatures()[0]
 definition = Script((s + '('), column=0).goto_definitions()[0]
 (signature.line == 1)
 (signature.column == 6)
 for attr_name in dir(definition):
  dont_scan = ['defined_names', 'line_nr', 'start_pos', 'documentation', 'doc', 'parent', 'goto_assignments']
  if (attr_name.startswith('_') or (attr_name in dont_scan)):
   continue
  attribute = getattr(definition, attr_name)
  signature_attribute = getattr(signature, attr_name)
  if inspect.ismethod(attribute):
   assert (attribute() == signature_attribute())
  else:
   assert (attribute == signature_attribute)

def test_signature_is_definition ( ) : s = 'class Spam(): pass\nSpam' signature = Script ( ( s + '(' ) ) . call_signatures ( ) [ 0 ] definition = Script ( ( s + '(' ) , column = 0 ) . goto_definitions ( ) [ 0 ] ( signature . line == 1 ) ( signature . column == 6 ) for attr_name in dir ( definition ) : dont_scan = [ 'defined_names' , 'line_nr' , 'start_pos' , 'documentation' , 'doc' , 'parent' , 'goto_assignments' ] if ( attr_name . startswith ( '_' ) or ( attr_name in dont_scan ) ) : continue attribute = getattr ( definition , attr_name ) signature_attribute = getattr ( signature , attr_name ) if inspect . ismethod ( attribute ) : assert ( attribute ( ) == signature_attribute ( ) ) else : assert ( attribute == signature_attribute )
through inheritance .