environment/lib/python2.7/site-packages/nose/suite.py
def ancestry(self, context):
        """Return the ancestry of the context (that is, all of the
        packages and modules containing the context), in order of
        descent with the outermost ancestor last.
        This method is a generator.
        """
        log.debug("get ancestry %s", context)
        if context is None:
            return
        # Methods include reference to module they are defined in, we
        # don't want that, instead want the module the class is in now
        # (classes are re-ancestored elsewhere).
        if hasattr(context, 'im_class'):
            context = context.im_class
        elif hasattr(context, '__self__'):
            context = context.__self__.__class__
        if hasattr(context, '__module__'):
            ancestors = context.__module__.split('.')
        elif hasattr(context, '__name__'):
            ancestors = context.__name__.split('.')[:-1]
        else:
            raise TypeError("%s has no ancestors?" % context)
        while ancestors:
            log.debug(" %s ancestors %s", context, ancestors)
            yield resolve_name('.'.join(ancestors))
            ancestors.pop()
def ancestry(self, context):
        """Return the ancestry of the context (that is, all of the
        packages and modules containing the context), in order of
        descent with the outermost ancestor last.
        This method is a generator.
        """
        log.debug("get ancestry %s", context)
        if context is None:
            return
        # Methods include reference to module they are defined in, we
        # don't want that, instead want the module the class is in now
        # (classes are re-ancestored elsewhere).
        if hasattr(context, 'im_class'):
            context = context.im_class
        elif hasattr(context, '__self__'):
            context = context.__self__.__class__
        if hasattr(context, '__module__'):
            ancestors = context.__module__.split('.')
        elif hasattr(context, '__name__'):
            ancestors = context.__name__.split('.')[:-1]
        else:
            raise TypeError("%s has no ancestors?" % context)
        while ancestors:
            log.debug(" %s ancestors %s", context, ancestors)
            yield resolve_name('.'.join(ancestors))
            ancestors.pop()
def ancestry ( self , context ) : log . debug ( "get ancestry %s" , context ) if context is None : return # Methods include reference to module they are defined in, we # don't want that, instead want the module the class is in now # (classes are re-ancestored elsewhere). if hasattr ( context , 'im_class' ) : context = context . im_class elif hasattr ( context , '__self__' ) : context = context . __self__ . __class__ if hasattr ( context , '__module__' ) : ancestors = context . __module__ . split ( '.' ) elif hasattr ( context , '__name__' ) : ancestors = context . __name__ . split ( '.' ) [ : - 1 ] else : raise TypeError ( "%s has no ancestors?" % context ) while ancestors : log . debug ( " %s ancestors %s" , context , ancestors ) yield resolve_name ( '.' . join ( ancestors ) ) ancestors . pop ( )
Return the ancestry of the context (that is, all of the
        packages and modules containing the context), in order of
        descent with the outermost ancestor last.
        This method is a generator.
Return the ancestry of the context ( that is all of the packages and modules containing the context ) in order of descent with the outermost ancestor last . This method is a generator .