import unittest
from nose.tools import set_trace


def fancy_attr(*args, **kwargs):
    """Decorator that adds attributes to classes or functions
    for use with the Attribute (-a) plugin. It also renames functions!
    """
    def wrap_ob(ob):
        for name in args:
            setattr(ob, name, True)
            #using __doc__ instead of __name__ works for class methods tests
            ob.__doc__ = '_'.join([ob.__name__, name])
            #ob.__name__ = '_'.join([ob.__name__, name])

        return ob

    return wrap_ob


class TestLogins(unittest.TestCase):
    @fancy_attr('slow')
    def test_method(self):
        assert True


@fancy_attr('slow')
def test_func():
    assert True
