def classmethods():
    if verbose: print "Testing class methods..."
    class C(object):
        def foo(*a): return a
        goo = classmethod(foo)
    c = C()
    vereq(C.goo(1), (C, 1))
    vereq(c.goo(1), (C, 1))
    vereq(c.foo(1), (c, 1))
    class D(C):
        pass
    d = D()
    vereq(D.goo(1), (D, 1))
    vereq(d.goo(1), (D, 1))
    vereq(d.foo(1), (d, 1))
    vereq(D.foo(d, 1), (d, 1))
    # Test for a specific crash (SF bug 528132)
    def f(cls, arg): return (cls, arg)
    ff = classmethod(f)
    vereq(ff.__get__(0, int)(42), (int, 42))
    vereq(ff.__get__(0)(42), (int, 42))

    # Test super() with classmethods (SF bug 535444)
    veris(C.goo.im_self, C)
    veris(D.goo.im_self, D)
    veris(super(D,D).goo.im_self, D)
    veris(super(D,d).goo.im_self, D)
    vereq(super(D,D).goo(), (D,))
    vereq(super(D,d).goo(), (D,))

    # Verify that argument is checked for callability (SF bug 753451)
    try:
        classmethod(1).__get__(1)
    except __HOLE__:
        pass
    else:
        raise TestFailed, "classmethod should check for callability"

    # Verify that classmethod() doesn't allow keyword args
    try:
        classmethod(f, kw=1)
    except TypeError:
        pass
    else:
        raise TestFailed, "classmethod shouldn't accept keyword args"
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/test_descr.py/classmethods