noseselecttests/__init__.py
def objname(obj):
    '''Return the context qualified name of a function, method or class obj'''
    if hasattr(obj, 'name'):
        return obj.name
    # name proper
    if hasattr(obj, '__name__'):
        names = [obj.__name__]
    else:
        #this is a class?
        names = [obj.__class__.__name__]

    # parent class if unbound method
    cls = None
    if six.PY2:
        if hasattr(obj, 'im_class'):
            # this is a method
            cls = obj.im_class
    else:
        if getattr(obj, '__self__', None) is not None:
            if getattr(obj.__self__, 'cls', None) is not None:
                cls = obj.__self__.cls
    # parent class if bound method
    if getattr(obj, '__self__', None) is not None:
        if getattr(obj.__self__, '__class__', None) is not None:
            cls = obj.__self__.__class__
    
    if cls is not None:
        names.insert(0, cls.__name__)

    # module, but ignore __main__ module
    if cls is not None:
        obj = cls
    if hasattr(obj, '__module__') and not obj.__module__.startswith('_'):
        names.insert(0, obj.__module__)
    name = '.'.join(names)
    return name
Return the context qualified name of a function, method or class obj
Return the context qualified name of a function, method or class obj
Return the context qualified name of a function method or class obj
def objname(obj):
    if hasattr(obj, 'name'):
        return obj.name
    if hasattr(obj, '__name__'):
        names = [obj.__name__]
    else:
        names = [obj.__class__.__name__]
    cls = None
    if six.PY2:
        if hasattr(obj, 'im_class'):
            cls = obj.im_class
    else:
        if getattr(obj, '__self__', None) is not None:
            if getattr(obj.__self__, 'cls', None) is not None:
                cls = obj.__self__.cls
    if getattr(obj, '__self__', None) is not None:
        if getattr(obj.__self__, '__class__', None) is not None:
            cls = obj.__self__.__class__
    if cls is not None:
        names.insert(0, cls.__name__)
    if cls is not None:
        obj = cls
    if hasattr(obj, '__module__') and not obj.__module__.startswith('_'):
        names.insert(0, obj.__module__)
    name = '.'.join(names)
    return name
def objname ( obj ) : if hasattr ( obj , 'name' ) : return obj . name if hasattr ( obj , '__name__' ) : names = [ obj . __name__ ] else : names = [ obj . __class__ . __name__ ] cls = None if six . PY2 : if hasattr ( obj , 'im_class' ) : cls = obj . im_class else : if getattr ( obj , '__self__' , None ) is not None : if getattr ( obj . __self__ , 'cls' , None ) is not None : cls = obj . __self__ . cls if getattr ( obj , '__self__' , None ) is not None : if getattr ( obj . __self__ , '__class__' , None ) is not None : cls = obj . __self__ . __class__ if cls is not None : names . insert ( 0 , cls . __name__ ) if cls is not None : obj = cls if hasattr ( obj , '__module__' ) and not obj . __module__ . startswith ( '_' ) : names . insert ( 0 , obj . __module__ ) name = '.' . join ( names ) return name
Return the context qualified name of a function, method or class obj
Return the context qualified name of a function method or class obj
'''Return the context qualified name of a function, method or class obj''' # name proper #this is a class? # parent class if unbound method # this is a method # parent class if bound method # module, but ignore __main__ module
obj